mirror of
https://github.com/plankanban/planka.git
synced 2025-07-23 15:19:44 +02:00
Merge branch 'master' into tests-for-UI
This commit is contained in:
commit
90bbd0d067
5 changed files with 94 additions and 0 deletions
19
client/nightwatch.conf.js
Normal file
19
client/nightwatch.conf.js
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
const path = require('path');
|
||||||
|
const LAUNCH_URL = process.env.LAUNCH_URL || 'http://localhost:3000';
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
page_objects_path: path.join(__dirname, 'tests' , 'acceptance', 'pageObjects'),
|
||||||
|
test_settings: {
|
||||||
|
default: {
|
||||||
|
launch_url: LAUNCH_URL,
|
||||||
|
selenium: {
|
||||||
|
start_process: false,
|
||||||
|
host: 'localhost',
|
||||||
|
port: 4444,
|
||||||
|
},
|
||||||
|
desiredCapabilities: {
|
||||||
|
browserName: 'chrome',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
|
@ -114,6 +114,8 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
||||||
|
"@cucumber/cucumber": "^7.3.1",
|
||||||
|
"@cucumber/pretty-formatter": "^1.0.0-alpha.1",
|
||||||
"@testing-library/jest-dom": "^6.5.0",
|
"@testing-library/jest-dom": "^6.5.0",
|
||||||
"@testing-library/react": "^15.0.7",
|
"@testing-library/react": "^15.0.7",
|
||||||
"@testing-library/user-event": "^14.5.2",
|
"@testing-library/user-event": "^14.5.2",
|
||||||
|
@ -125,6 +127,8 @@
|
||||||
"eslint-plugin-jsx-a11y": "^6.10.0",
|
"eslint-plugin-jsx-a11y": "^6.10.0",
|
||||||
"eslint-plugin-react": "^7.36.1",
|
"eslint-plugin-react": "^7.36.1",
|
||||||
"eslint-plugin-react-hooks": "^4.6.2",
|
"eslint-plugin-react-hooks": "^4.6.2",
|
||||||
|
"nightwatch": "^1.7.8",
|
||||||
|
"nightwatch-api": "^3.0.2",
|
||||||
"react-test-renderer": "18.2.0"
|
"react-test-renderer": "18.2.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
25
client/tests/acceptance/cucumber.conf.js
Normal file
25
client/tests/acceptance/cucumber.conf.js
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
const {
|
||||||
|
After,
|
||||||
|
Before,
|
||||||
|
AfterAll,
|
||||||
|
BeforeAll,
|
||||||
|
setDefaultTimeout,
|
||||||
|
} = require("@cucumber/cucumber");
|
||||||
|
const { createSession, closeSession } = require("nightwatch-api");
|
||||||
|
|
||||||
|
setDefaultTimeout(60000);
|
||||||
|
// runs before all scenarios
|
||||||
|
BeforeAll(async function () {});
|
||||||
|
|
||||||
|
// runs before each scenario
|
||||||
|
Before(async function () {
|
||||||
|
await createSession();
|
||||||
|
});
|
||||||
|
|
||||||
|
// runs after each scenario
|
||||||
|
After(async function () {
|
||||||
|
await closeSession();
|
||||||
|
});
|
||||||
|
|
||||||
|
// runs after all scenarios
|
||||||
|
AfterAll(async function () {});
|
20
client/tests/acceptance/pageObjects/dashboardPage.js
Normal file
20
client/tests/acceptance/pageObjects/dashboardPage.js
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
module.exports = {
|
||||||
|
url: function () {
|
||||||
|
return this.api.launchUrl + "/dashboard";
|
||||||
|
},
|
||||||
|
commands: {
|
||||||
|
isDashboardPage: async function () {
|
||||||
|
let result = false;
|
||||||
|
await this.waitForElementVisible("@dashboardHeader");
|
||||||
|
await this.isVisible("@dashboardHeader", (res) => {
|
||||||
|
result = res.value;
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
elements: {
|
||||||
|
dashboardHeader: {
|
||||||
|
selector: "a.Header_title__3SEjb",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
26
client/tests/acceptance/pageObjects/loginPage.js
Normal file
26
client/tests/acceptance/pageObjects/loginPage.js
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
module.exports = {
|
||||||
|
url: function () {
|
||||||
|
return this.api.launchUrl + "/login";
|
||||||
|
},
|
||||||
|
commands: {
|
||||||
|
logIn: function (email, password) {
|
||||||
|
return this.waitForElementVisible("@emailInput")
|
||||||
|
.setValue("@emailInput", email)
|
||||||
|
.waitForElementVisible("@passwordInput")
|
||||||
|
.setValue("@passwordInput", password)
|
||||||
|
.waitForElementVisible("@loginBtn")
|
||||||
|
.click("@loginBtn");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
elements: {
|
||||||
|
emailInput: {
|
||||||
|
selector: "input[name=emailOrUsername]",
|
||||||
|
},
|
||||||
|
passwordInput: {
|
||||||
|
selector: "input[name=password]",
|
||||||
|
},
|
||||||
|
loginBtn: {
|
||||||
|
selector: "form button",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
Loading…
Add table
Add a link
Reference in a new issue