Skip to content

Commit c259632

Browse files
committed
added setup files for testing
added dotenv files used variables from .env set slowmo time to 0 cucumber config file edited
1 parent 399af3d commit c259632

File tree

3 files changed

+2038
-0
lines changed

3 files changed

+2038
-0
lines changed

tests/cucumber.conf.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
const { Before, BeforeAll, AfterAll, After, setDefaultTimeout } = require("@cucumber/cucumber");
2+
const { chromium } = require("playwright");
3+
require('dotenv').config();
4+
5+
const timeout = process.env.TIME_OUT ? parseInt(process.env.TIME_OUT) : 60000;
6+
setDefaultTimeout(timeout);
7+
8+
BeforeAll(async function () {
9+
global.browser = await chromium.launch({
10+
headless: process.env.HEADLESS === "false" ? false : true,
11+
slowMo: process.env.SLOW_MO ? parseInt(process.env.SLOW_MO) : 0,
12+
})
13+
});
14+
15+
Before(async function () {
16+
global.context = await global.browser.newContext();
17+
global.page = await global.context.newPage();
18+
});
19+
20+
After(async function () {
21+
await global.page.close();
22+
await global.context.close();
23+
});
24+
25+
AfterAll(async function() {
26+
await global.browser.close();
27+
});

0 commit comments

Comments
 (0)