Skip to content

rendezvous14/marsair-assignment

Repository files navigation

marsair-assignment

Mars Airlines Assignment

End-to-end testing powered by playwright with typescript

Setup

0. Require Nodejs to setup this project

Recommended to use asdf-vm and plugin NodeJS. See more detail by this link asdf-vm-nodejs

asdf install nodejs 20.5.1

1. Clone the project

git clone https://github.com/rendezvous14/marsair-assignment.git

2. install dependencies

npm install
npx playwright install

3. set up environment variables

Copy file from 1PW and paste it into .env file on the project directory

playwright run with different option

playwright run open mode on specific test

Use VS Code with Playwright Test for VSCode:

  1. Select Testing tab

  2. Select test case that you want to run

    • Click Debug to run specific test with browser open. You can set breakpoint and step through code as well
    • Click Run to run specific test in headless mode

playwright run with ui mode

$ npm run test-ui

output

npm_run_test-ui

playwright run headless mode

$ npm run test

output

npm_run_test

playwright generate html report

$ npm run report

Test structures

tests directory

keep all test cases which are separated by features

tests
└── searching
    ├── basicWorkflow.test.ts
    ├── promotionCode.test.ts
    └── ui.test.ts

src directory

keep all the resources e.g. constants, services, pages (POM), utils, helper

src
├── constants
│   └── searchOptions.ts
└── pages
    ├── home.page.ts
    └── searchResult.page.ts

About

Mars Airlines Assignment

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published