Giter VIP home page Giter VIP logo

test_app's Introduction

TEST APP

This is a test app.

The app contains bugs. Some of them are meant to be there while some might be usual bugs that appear during development.

Your task is to write a set of automated tests for it using pytest framework.

Let's see how many of them you'll be able to find with automated tests!

App spec

Test app allows users to upload templates and then render a simple Web page using this template. The rendered page will contain buttons with the links provided. The web page and API are available on http://localhost:5000/ after the app is launched.

Build

The app should be started in a docker using

docker build --tag test_app:latest .

docker run -p 5000:5000 -d test_app:latest

Template should be a list of the following blocks in Yaml format:

 -  id: {Element id. Mandatory}
    label: {Button label. Mandatory}
    link: {Web link. Optional}
    depends: {Id of parrent element. Optional}

Constraints

  • Each element should have id and label
  • id should be unique
  • If a link is not set for the element corresponding button will be rendered as disabled
  • Parent element should be present in the list of elements
  • Buttons on the rendered page should be clickable except case with no link provided

API spec

Upload template

Upload your template file.

If tmpl_id is not provided in the request body then tmpl_id will be generated based on the filename.

Name Value
Endpoint /api/v1/templates
Method POST
  • Body

    Content-type: Form-data

    • Required:

    file=[file]

    • Optional:

    data={"tmpl_id":"my_custom_id"}

List templates

List all currently uploaded templates

Name Value
Endpoint /api/v1/templates
Method GET

Delete template

Delete previously loaded template file

Name Value
Endpoint /api/v1/templates/{tmpl_id}
Method DELETE
  • URL Params

    Required:

    tmpl_id=[string]

Install template

Install previously loaded template file

Name Value
Endpoint /api/v1/templates/{tmpl_id}/install
Method POST
  • URL Params

    Required:

    tmpl_id=[string]

test_app's People

Contributors

dependabot[bot] avatar dgusakov avatar

Watchers

 avatar  avatar

test_app's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.