Code Monkey home page Code Monkey logo

hobbyfarm-e2e-testing's Introduction

End-to-end testing solution for HobbyFarm

CI Nightly

Automated testing solution to validate HobbyFarm (API + web app), the Cloud Native e-learning platform!

Current state

This repository has been created in February 2023 and the first working version has been completed in May 2023.

The design has been documented in ADRs (Architecture Decision Record): Solution init (Feb 2023).

How to run tests

The technical solution is based on Playwright. The following setup is required in order to run the tests on a machine:

# installs NPM packages
npm install

# installs Playwright dependencies
npx playwright install --with-deps

Environment variables needs to be set to target a specific environment. Locally, you can copy .env.example to create and edit .env file that will be used to configure the tests (thanks to dotenv).

Once the setup and configuration is completed, you can run several commands:

# runs the end-to-end tests (see https://playwright.dev/docs/running-tests)
npx playwright test

# run the tests from the test browser (really cool to see & debug!)
npx playwright test --ui

# opens last HTML report run
npx playwright show-report

# opens a browser to help generate tests (see https://playwright.dev/docs/codegen for options)
npx playwright codegen

How to run acceptance tests

Acceptance testing has been written in Gherkin languages and are mapped to the code thanks to Cucumber (code)

# runs features defined in acceptance folder
npx cucumber-js

How to contribute

File organization

You can start editing files in tests folders and look at examples in samples folder. For UI testing, the PageObject pattern has been followed and code is found in src/pages. For REST API testing, code is in src/resources.

To go further you can have a look at .\playwright.config.ts (Playwright Test configuration) and Playwright documentation.

IDE

If you use Visual Studio Code, you can install the extension Playwright Test for VSCode (repository).

Libraries

Code quality

We use MegaLinter (code) to check all code from this repository. It will be automatically used in the CI pipeline but you can run it locally:

npx mega-linter-runner

You can also run specific linters:

npx eslint .

How to operate

hobbyfarm-e2e-testing's People

Contributors

devpro avatar michaelhesemann avatar abrahimi93 avatar arne232 avatar jggoebel avatar

Stargazers

Roman avatar

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.