mirror of
https://github.com/plankanban/planka.git
synced 2025-08-05 05:25:29 +02:00
test: Add BDD UI tests using Playwright (#911)
This commit is contained in:
parent
4efc3be8d5
commit
096feb35bb
17 changed files with 1260 additions and 120 deletions
|
@ -1,25 +1,35 @@
|
|||
const {
|
||||
After,
|
||||
Before,
|
||||
AfterAll,
|
||||
BeforeAll,
|
||||
setDefaultTimeout,
|
||||
} = require("@cucumber/cucumber");
|
||||
const { createSession, closeSession } = require("nightwatch-api");
|
||||
// cucumber.conf.js file
|
||||
|
||||
setDefaultTimeout(60000);
|
||||
// runs before all scenarios
|
||||
BeforeAll(async function () {});
|
||||
const { Before, BeforeAll, AfterAll, After, setDefaultTimeout } = require('@cucumber/cucumber');
|
||||
const { chromium } = require('playwright');
|
||||
const { deleteProject } = require('./testHelpers/apiHelpers');
|
||||
const config = require('./config');
|
||||
|
||||
// runs before each scenario
|
||||
setDefaultTimeout(config.timeout);
|
||||
|
||||
// launch the browser
|
||||
BeforeAll(async function () {
|
||||
global.browser = await chromium.launch({
|
||||
// makes true for CI
|
||||
headless: config.headless,
|
||||
slowMo: config.slowMo,
|
||||
});
|
||||
});
|
||||
|
||||
// close the browser
|
||||
AfterAll(async function () {
|
||||
await global.browser.close();
|
||||
});
|
||||
|
||||
// Create a new browser context and page per scenario
|
||||
Before(async function () {
|
||||
await createSession();
|
||||
global.context = await global.browser.newContext();
|
||||
global.page = await global.context.newPage();
|
||||
});
|
||||
|
||||
// runs after each scenario
|
||||
// Cleanup after each scenario
|
||||
After(async function () {
|
||||
await closeSession();
|
||||
await deleteProject();
|
||||
await global.page.close();
|
||||
await global.context.close();
|
||||
});
|
||||
|
||||
// runs after all scenarios
|
||||
AfterAll(async function () {});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue