Skip to content

Commit

Permalink
added setup files for testing
Browse files Browse the repository at this point in the history
added dotenv files

used variables from .env

set slowmo time to 0

cucumber config file edited
  • Loading branch information
ishabaral committed Apr 10, 2024
1 parent 399af3d commit c259632
Show file tree
Hide file tree
Showing 3 changed files with 2,038 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/cucumber.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const { Before, BeforeAll, AfterAll, After, setDefaultTimeout } = require("@cucumber/cucumber");
const { chromium } = require("playwright");
require('dotenv').config();

const timeout = process.env.TIME_OUT ? parseInt(process.env.TIME_OUT) : 60000;
setDefaultTimeout(timeout);

BeforeAll(async function () {
global.browser = await chromium.launch({
headless: process.env.HEADLESS === "false" ? false : true,
slowMo: process.env.SLOW_MO ? parseInt(process.env.SLOW_MO) : 0,
})
});

Before(async function () {
global.context = await global.browser.newContext();
global.page = await global.context.newPage();
});

After(async function () {
await global.page.close();
await global.context.close();
});

AfterAll(async function() {
await global.browser.close();
});
Loading

0 comments on commit c259632

Please sign in to comment.