-
Install your dependencies:
npm run bootstrap
-
Configure
.env
file:Create a
.env
file in the root folder and copy the contents from.env.example
to it and fill the essential values.
-
Run tests:
npm run test:qa
npm run test:performance
-
Create new test:
cd e2e_tests && npm run create_test {category_name} {test_name}
-
File Structure
src ├── __tests__/ │ ├── [category_name]/ | ├── [test_name].test.js ├── _config/ ├── _utils/ ├── objects/ ├── bootstrap.js
-
Playwright documents: We use playwright to run our tests so it's very useful to take a look at this documentation.
-
Create a browser: You can setup a browser with mobile or desktop viewport before runing each test starts and tear down the browser after runing each test like this:
const { setUp, tearDown, desktop_viewport, mobile_viewport } = require('@root/bootstrap'); beforeEach(async () => { const out = await setUp(mobile_viewport); // for mobile viewport const out = await setUp(desktop_viewport); // for desktop viewport }); afterEach(async () => { await tearDown(browser); }); test('It shouls pass', () => { // your test logic });
-
Creating a page: You can create a page and navigate to
Home_Page
like this:const { browser, context } = await setUp(mobile_viewport); await context.addInitScript(replaceWebsocket); const page = new Common(await context.newPage()); await page.navigate(); // navigate to HOME_URL (process.env.HOME_URL)
Now, you can use all helper functions in
@root/objects/common.js
to perform actions to the created page. Also, read this documentation to see more provided methods.