migrate: make all remaining e2e tests work

This commit is contained in:
Johannes Millan 2024-06-18 16:43:44 +02:00
parent 724d5247fb
commit fb938b2ab2
5 changed files with 21 additions and 38 deletions

View file

@ -4,7 +4,7 @@ import { NBrowser } from '../n-browser-interface';
const BASE_URL = `${BASE}`;
const SIDENAV = `side-nav`;
const EXPAND_PROJECT_BTN = `${SIDENAV} .expand-btn:first-of-type`;
const EXPAND_PROJECT_BTN = `${SIDENAV} .projects .expand-btn`;
const PROJECT = `${SIDENAV} section.projects .project`;
const DEFAULT_PROJECT = `${PROJECT}:nth-of-type(1)`;

View file

@ -20,6 +20,23 @@ module.exports = {
launch_url: 'https://localhost:4200',
desiredCapabilities: {
browserName: 'chrome',
chromeOptions: {
args: [
'--headless',
'--disable-gpu',
'--window-size=1280,800',
'--no-sandbox',
'--disable-dev-shm-usage',
'--disable-browser-side-navigation',
'--user-agent=NIGHTWATCH',
`--binary=${process.env.CHROME_BIN}`,
],
// w3c: false,
prefs: {
'profile.default_content_setting_values.geolocation': 1,
'profile.default_content_setting_values.notifications': 2,
},
},
},
screenshots: {
enabled: true, // if you want to keep screenshots
@ -32,40 +49,6 @@ module.exports = {
waitForConditionTimeout: 10000,
retryAssertionTimeout: 1000,
},
webdriver: {
start_process: true,
server_path: '',
},
},
chrome: {
desiredCapabilities: {
browserName: 'chrome',
chromeOptions: {
args: [
'--headless',
'--disable-gpu',
'--window-size=1280,800',
'--no-sandbox',
'--disable-dev-shm-usage',
'--disable-browser-side-navigation',
'--user-agent=NIGHTWATCH',
// `--binary=${process.env.CHROME_BIN}`
],
w3c: false,
prefs: {
'profile.default_content_setting_values.geolocation': 1,
'profile.default_content_setting_values.notifications': 2,
},
},
},
webdriver: {
start_process: true,
server_path: '',
cli_args: [
// --verbose
],
},
},
},
};

View file

@ -12,7 +12,7 @@ const TASK_SCHEDULE_BTN_2 = TASK_2 + ' ' + TASK_SCHEDULE_BTN;
const SCHEDULE_ROUTE_BTN = 'button[routerlink="schedule"]';
const SCHEDULE_PAGE_CMP = 'schedule-page';
const SCHEDULE_PAGE_TASKS = `${SCHEDULE_PAGE_CMP} .tasks > .mat-card`;
const SCHEDULE_PAGE_TASKS = `${SCHEDULE_PAGE_CMP} .tasks mat-card`;
const SCHEDULE_PAGE_TASK_1 = `${SCHEDULE_PAGE_TASKS}:first-of-type`;
// Note: not sure why this is the second child, but it is
const SCHEDULE_PAGE_TASK_2 = `${SCHEDULE_PAGE_TASKS}:nth-of-type(2)`;

View file

@ -63,7 +63,7 @@
"lint": "ng lint",
"prebuild": "node ./tools/git-version.js",
"preCheck": "npm run lint && npm run test & npm run int:test && npm run e2e",
"e2e": "cross-env TZ='' DETECT_CHROMEDRIVER_VERSION=true SKIP_POST_INSTALL=true npm i -D chromedriver --legacy-peer-deps && tsc --project e2e/tsconfig.e2e.json && start-server-and-test 'ng serve --no-live-reload' 4200 'nightwatch -c ./e2e/nightwatch.conf.js --suiteRetries 1 --retries 0 --headless'",
"e2e": "cross-env TZ='' DETECT_CHROMEDRIVER_VERSION=true SKIP_POST_INSTALL=true npm i -D chromedriver --legacy-peer-deps && tsc --project e2e/tsconfig.e2e.json && start-server-and-test 'ng serve --no-live-reload' 4200 'nightwatch -c ./e2e/nightwatch.conf.js --suiteRetries 1 --retries 0'",
"e2e:tag": "killall chromedriver; rm -R ./out-tsc; tsc --project e2e/tsconfig.e2e.json && nightwatch -c ./e2e/nightwatch.conf.js --suiteRetries 0 --retries 0 --tag ",
"electron": "NODE_ENV=PROD electron .",
"electron:build": "tsc -p electron/tsconfig.electron.json",

View file

@ -19,7 +19,7 @@ body .mat-mdc-dialog-surface {
.mat-mdc-dialog-panel {
@include mq(xs) {
--mat-dialog-container-min-width: 450px;
//--mat-dialog-container-min-width: 350px;
}
}