mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-18 00:46:45 +00:00
migrate: more e2e tests
This commit is contained in:
parent
6f6c626683
commit
c80b8e2eec
10 changed files with 376 additions and 381 deletions
|
|
@ -8,7 +8,7 @@ const EXPAND_PROJECT_BTN = `${SIDENAV} .expand-btn:first-of-type`;
|
|||
|
||||
const PROJECT = `${SIDENAV} section.projects .project`;
|
||||
const DEFAULT_PROJECT = `${PROJECT}:nth-of-type(1)`;
|
||||
const DEFAULT_PROJECT_BTN = `${DEFAULT_PROJECT} .mat-menu-item`;
|
||||
const DEFAULT_PROJECT_BTN = `${DEFAULT_PROJECT} .mat-mdc-menu-item`;
|
||||
|
||||
const TASK_LIST = `task-list`;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,8 +5,6 @@ const BASE_URL = `${BASE}`;
|
|||
|
||||
module.exports = {
|
||||
async command(this: NightwatchBrowser, url: string = BASE_URL) {
|
||||
console.log(url);
|
||||
// return this.url(url).waitForElementVisible('mat-sidenav-container').url(url);
|
||||
return this.url(url);
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,29 +1,25 @@
|
|||
// import { BASE } from '../e2e.const';
|
||||
// import { NBrowser } from '../n-browser-interface';
|
||||
// /* eslint-disable @typescript-eslint/naming-convention */
|
||||
//
|
||||
// const URL = `${BASE}/#/tag/TODAY/daily-summary`;
|
||||
// const ADD_TASK_BTN_SEL = '.action-nav > button:first-child';
|
||||
// const ADD_TASK_GLOBAL_SEL = 'add-task-bar.global input';
|
||||
//
|
||||
// module.exports = {
|
||||
// '@tags': ['daily-summary'],
|
||||
//
|
||||
// 'Daily summary message': (browser: NBrowser) =>
|
||||
// browser
|
||||
// .loadAppAndClickAwayWelcomeDialog(URL)
|
||||
// .waitForElementVisible('.done-headline')
|
||||
// .assert.containsText('.done-headline', 'Take a moment to celebrate')
|
||||
// .end(),
|
||||
//
|
||||
// 'show any added task in table': (browser: NBrowser) =>
|
||||
// browser
|
||||
// .loadAppAndClickAwayWelcomeDialog(URL)
|
||||
// .waitForElementVisible(ADD_TASK_BTN_SEL)
|
||||
// .click(ADD_TASK_BTN_SEL)
|
||||
// .waitForElementVisible(ADD_TASK_GLOBAL_SEL)
|
||||
//
|
||||
// .setValue(ADD_TASK_GLOBAL_SEL, 'test task hohoho')
|
||||
// .setValue(ADD_TASK_GLOBAL_SEL, browser.Keys.ENTER)
|
||||
// .end(),
|
||||
// };
|
||||
import { BASE } from '../e2e.const';
|
||||
import { NBrowser } from '../n-browser-interface';
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
|
||||
const URL = `${BASE}/#/tag/TODAY/daily-summary`;
|
||||
const SUMMARY_TABLE_TASK_EL = '.task-title .value-wrapper';
|
||||
|
||||
module.exports = {
|
||||
'@tags': ['daily-summary'],
|
||||
|
||||
'Daily summary message': (browser: NBrowser) =>
|
||||
browser
|
||||
.loadAppAndClickAwayWelcomeDialog(URL)
|
||||
.waitForElementVisible('.done-headline')
|
||||
.assert.textContains('.done-headline', 'Take a moment to celebrate')
|
||||
.end(),
|
||||
|
||||
'show any added task in table': (browser: NBrowser) =>
|
||||
browser
|
||||
.loadAppAndClickAwayWelcomeDialog(URL)
|
||||
.addTask('test task hohoho 1h/1h')
|
||||
.waitForElementVisible(SUMMARY_TABLE_TASK_EL)
|
||||
.assert.textContains(SUMMARY_TABLE_TASK_EL, 'test task hohoho')
|
||||
.end(),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,41 +1,41 @@
|
|||
// import { NBrowser } from '../n-browser-interface';
|
||||
//
|
||||
// const TOGGLE_BOOKMARK_BAR_BTN = '.action-nav button:nth-child(3)';
|
||||
// const BOOKMARK_BAR_OPTS_BTN = 'bookmark-bar .list-controls button:first-of-type';
|
||||
// const ADD_BOOKMARK_BTN = '.mat-menu-panel .mat-menu-item:first-of-type';
|
||||
//
|
||||
// const ADD_BOOKMARK_DIALOG = 'dialog-edit-bookmark';
|
||||
// const BOOKMARK_TITLE_INP = `${ADD_BOOKMARK_DIALOG} input[name=title]`;
|
||||
// const BOOKMARK_URL_INP = `${ADD_BOOKMARK_DIALOG} input[name=path]`;
|
||||
// const BOOKMARK_SUBMIT_BTN = `${ADD_BOOKMARK_DIALOG} button[type=submit]:enabled`;
|
||||
//
|
||||
// const BOOKMARK = '.global-bookmark-list-inner .global-bookmark';
|
||||
// const FIRST_BOOKMARK = `${BOOKMARK}:first-of-type`;
|
||||
// /* eslint-disable @typescript-eslint/naming-convention */
|
||||
//
|
||||
// module.exports = {
|
||||
// '@tags': ['bookmark'],
|
||||
// 'create a bookmark': (browser: NBrowser) =>
|
||||
// browser
|
||||
// .goToDefaultProject()
|
||||
//
|
||||
// .waitForElementVisible(TOGGLE_BOOKMARK_BAR_BTN)
|
||||
// .click(TOGGLE_BOOKMARK_BAR_BTN)
|
||||
//
|
||||
// .waitForElementVisible(BOOKMARK_BAR_OPTS_BTN)
|
||||
// .click(BOOKMARK_BAR_OPTS_BTN)
|
||||
//
|
||||
// .waitForElementVisible(ADD_BOOKMARK_BTN)
|
||||
// .click(ADD_BOOKMARK_BTN)
|
||||
//
|
||||
// .waitForElementVisible(BOOKMARK_TITLE_INP)
|
||||
// .setValue(BOOKMARK_TITLE_INP, 'Some bookmark title')
|
||||
// .waitForElementVisible(BOOKMARK_URL_INP)
|
||||
// .setValue(BOOKMARK_URL_INP, 'bookmark-url.de')
|
||||
// .click(BOOKMARK_SUBMIT_BTN)
|
||||
//
|
||||
// .waitForElementVisible(FIRST_BOOKMARK)
|
||||
// .assert.elementPresent(FIRST_BOOKMARK)
|
||||
// .assert.containsText(FIRST_BOOKMARK, 'Some bookmark title')
|
||||
// .end(),
|
||||
// };
|
||||
import { NBrowser } from '../n-browser-interface';
|
||||
|
||||
const TOGGLE_BOOKMARK_BAR_BTN = '.action-nav button:nth-child(3)';
|
||||
const BOOKMARK_BAR_OPTS_BTN = 'bookmark-bar .list-controls button:first-of-type';
|
||||
const ADD_BOOKMARK_BTN = '.mat-mdc-menu-panel .mat-mdc-menu-item:first-of-type';
|
||||
|
||||
const ADD_BOOKMARK_DIALOG = 'dialog-edit-bookmark';
|
||||
const BOOKMARK_TITLE_INP = `${ADD_BOOKMARK_DIALOG} input[name=title]`;
|
||||
const BOOKMARK_URL_INP = `${ADD_BOOKMARK_DIALOG} input[name=path]`;
|
||||
const BOOKMARK_SUBMIT_BTN = `${ADD_BOOKMARK_DIALOG} button[type=submit]:enabled`;
|
||||
|
||||
const BOOKMARK = '.global-bookmark-list-inner .global-bookmark';
|
||||
const FIRST_BOOKMARK = `${BOOKMARK}:first-of-type`;
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
|
||||
module.exports = {
|
||||
'@tags': ['bookmark'],
|
||||
'create a bookmark': (browser: NBrowser) =>
|
||||
browser
|
||||
.goToDefaultProject()
|
||||
|
||||
.waitForElementVisible(TOGGLE_BOOKMARK_BAR_BTN)
|
||||
.click(TOGGLE_BOOKMARK_BAR_BTN)
|
||||
|
||||
.waitForElementVisible(BOOKMARK_BAR_OPTS_BTN)
|
||||
.click(BOOKMARK_BAR_OPTS_BTN)
|
||||
|
||||
.waitForElementVisible(ADD_BOOKMARK_BTN)
|
||||
.click(ADD_BOOKMARK_BTN)
|
||||
|
||||
.waitForElementVisible(BOOKMARK_TITLE_INP)
|
||||
.setValue(BOOKMARK_TITLE_INP, 'Some bookmark title')
|
||||
.waitForElementVisible(BOOKMARK_URL_INP)
|
||||
.setValue(BOOKMARK_URL_INP, 'bookmark-url.de')
|
||||
.click(BOOKMARK_SUBMIT_BTN)
|
||||
|
||||
.waitForElementVisible(FIRST_BOOKMARK)
|
||||
.assert.elementPresent(FIRST_BOOKMARK)
|
||||
.assert.textContains(FIRST_BOOKMARK, 'Some bookmark title')
|
||||
.end(),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,38 +1,38 @@
|
|||
// import { NBrowser } from '../n-browser-interface';
|
||||
// /* eslint-disable @typescript-eslint/naming-convention */
|
||||
//
|
||||
// const NOTES_WRAPPER = 'notes';
|
||||
// const NOTE = 'notes note';
|
||||
// const FIRST_NOTE = `${NOTE}:first-of-type`;
|
||||
// const TOGGLE_NOTES_BTN = '.toggle-notes-btn';
|
||||
//
|
||||
// module.exports = {
|
||||
// '@tags': ['note'],
|
||||
//
|
||||
// 'create a note': (browser: NBrowser) =>
|
||||
// browser
|
||||
// .goToDefaultProject()
|
||||
// .addNote('Some new Note')
|
||||
//
|
||||
// .moveToElement(NOTES_WRAPPER, 10, 50)
|
||||
// .waitForElementVisible(FIRST_NOTE)
|
||||
// .assert.elementPresent(FIRST_NOTE)
|
||||
// .assert.containsText(FIRST_NOTE, 'Some new Note')
|
||||
// .end(),
|
||||
//
|
||||
// 'new note should be still available after reload': (browser: NBrowser) =>
|
||||
// browser
|
||||
// .goToDefaultProject()
|
||||
// .addNote('Some new Note')
|
||||
// // wait for save
|
||||
// .pause(200)
|
||||
// .execute('window.location.reload()')
|
||||
// .waitForElementPresent(TOGGLE_NOTES_BTN)
|
||||
// .click(TOGGLE_NOTES_BTN)
|
||||
// .waitForElementPresent(NOTES_WRAPPER)
|
||||
// .moveToElement(NOTES_WRAPPER, 10, 50)
|
||||
// .waitForElementVisible(FIRST_NOTE)
|
||||
// .assert.elementPresent(FIRST_NOTE)
|
||||
// .assert.containsText(FIRST_NOTE, 'Some new Note')
|
||||
// .end(),
|
||||
// };
|
||||
import { NBrowser } from '../n-browser-interface';
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
|
||||
const NOTES_WRAPPER = 'notes';
|
||||
const NOTE = 'notes note';
|
||||
const FIRST_NOTE = `${NOTE}:first-of-type`;
|
||||
const TOGGLE_NOTES_BTN = '.toggle-notes-btn';
|
||||
|
||||
module.exports = {
|
||||
'@tags': ['note'],
|
||||
|
||||
'create a note': (browser: NBrowser) =>
|
||||
browser
|
||||
.goToDefaultProject()
|
||||
.addNote('Some new Note')
|
||||
|
||||
.moveToElement(NOTES_WRAPPER, 10, 50)
|
||||
.waitForElementVisible(FIRST_NOTE)
|
||||
.assert.textContains(FIRST_NOTE, 'Some new Note')
|
||||
.end(),
|
||||
|
||||
'new note should be still available after reload': (browser: NBrowser) =>
|
||||
browser
|
||||
.goToDefaultProject()
|
||||
|
||||
.addNote('Some new Note')
|
||||
// wait for save
|
||||
.pause(200)
|
||||
.execute('window.location.reload()')
|
||||
.waitForElementPresent(TOGGLE_NOTES_BTN)
|
||||
.click(TOGGLE_NOTES_BTN)
|
||||
.waitForElementPresent(NOTES_WRAPPER)
|
||||
.moveToElement(NOTES_WRAPPER, 10, 50)
|
||||
.waitForElementVisible(FIRST_NOTE)
|
||||
.assert.elementPresent(FIRST_NOTE)
|
||||
.assert.textContains(FIRST_NOTE, 'Some new Note')
|
||||
.end(),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,99 +1,100 @@
|
|||
// import { BASE } from '../e2e.const';
|
||||
// import { NBrowser } from '../n-browser-interface';
|
||||
// /* eslint-disable @typescript-eslint/naming-convention */
|
||||
//
|
||||
// const SIDENAV = `side-nav`;
|
||||
// const EXPAND_PROJECT_BTN = `${SIDENAV} .expand-btn:first-of-type`;
|
||||
// const CREATE_PROJECT_BTN = `${SIDENAV} section.projects .mat-menu-item:last-of-type`;
|
||||
//
|
||||
// const PROJECT_NAME_INPUT = `dialog-create-project input:first-of-type`;
|
||||
// const SUBMIT_BTN = `dialog-create-project button[type=submit]:enabled`;
|
||||
//
|
||||
// const PROJECT = `${SIDENAV} section.projects .project`;
|
||||
// const DEFAULT_PROJECT = `${PROJECT}:nth-of-type(1)`;
|
||||
// const DEFAULT_PROJECT_BTN = `${DEFAULT_PROJECT} .mat-menu-item`;
|
||||
// const DEFAULT_PROJECT_ADV_BTN = `${DEFAULT_PROJECT} .project-settings-btn`;
|
||||
//
|
||||
// const WORK_CTX_MENU = `work-context-menu`;
|
||||
// const WORK_CTX_TITLE = `.current-work-context-title`;
|
||||
//
|
||||
// const PROJECT_SETTINGS_BTN = `${WORK_CTX_MENU} button:last-of-type`;
|
||||
// const SECOND_PROJECT = `${PROJECT}:nth-of-type(2)`;
|
||||
// const SECOND_PROJECT_BTN = `${SECOND_PROJECT} button:first-of-type`;
|
||||
//
|
||||
// // const BACKLOG = `.backlog`;
|
||||
// // const SPLIT = `split`;
|
||||
// const FINISH_DAY_BTN = 'button[routerlink="/active/daily-summary"]';
|
||||
// const READY_TO_WORK_BTN = '.ready-to-work-btn';
|
||||
// const DAILY_SUMMARY = 'daily-summary';
|
||||
// const GLOBAL_ERROR_ALERT = '.global-error-alert';
|
||||
//
|
||||
// module.exports = {
|
||||
// '@tags': ['project'],
|
||||
//
|
||||
// 'navigate to project settings': (browser: NBrowser) =>
|
||||
// browser
|
||||
// .loadAppAndClickAwayWelcomeDialog()
|
||||
// .waitForElementVisible(EXPAND_PROJECT_BTN)
|
||||
// .click(EXPAND_PROJECT_BTN)
|
||||
// .waitForElementVisible(DEFAULT_PROJECT_BTN)
|
||||
// .moveToElement(DEFAULT_PROJECT_BTN, 20, 20)
|
||||
// .waitForElementVisible(DEFAULT_PROJECT_ADV_BTN)
|
||||
// .click(DEFAULT_PROJECT_ADV_BTN)
|
||||
// .waitForElementVisible(WORK_CTX_MENU)
|
||||
// .waitForElementVisible(PROJECT_SETTINGS_BTN)
|
||||
//
|
||||
// // navigate to
|
||||
// .click(PROJECT_SETTINGS_BTN)
|
||||
//
|
||||
// .waitForElementVisible('.component-wrapper .mat-h1')
|
||||
// .assert.containsText('.component-wrapper .mat-h1', 'Project Specific Settings')
|
||||
// .end(),
|
||||
//
|
||||
// 'create project': (browser: NBrowser) =>
|
||||
// browser
|
||||
// .loadAppAndClickAwayWelcomeDialog()
|
||||
// .waitForElementVisible(EXPAND_PROJECT_BTN)
|
||||
// .click(EXPAND_PROJECT_BTN)
|
||||
// .waitForElementVisible(CREATE_PROJECT_BTN)
|
||||
// .click(CREATE_PROJECT_BTN)
|
||||
// .waitForElementVisible(PROJECT_NAME_INPUT)
|
||||
// .setValue(PROJECT_NAME_INPUT, 'Cool Test Project')
|
||||
// .click(SUBMIT_BTN)
|
||||
//
|
||||
// .waitForElementVisible(SECOND_PROJECT)
|
||||
// .assert.elementPresent(SECOND_PROJECT)
|
||||
// .assert.containsText(SECOND_PROJECT, 'Cool Test Project')
|
||||
//
|
||||
// // navigate to
|
||||
// .waitForElementVisible(SECOND_PROJECT_BTN)
|
||||
// .click(SECOND_PROJECT_BTN)
|
||||
//
|
||||
// // .waitForElementVisible(BACKLOG)
|
||||
// // .waitForElementVisible(SPLIT)
|
||||
// .assert.containsText(WORK_CTX_TITLE, 'Cool Test Project')
|
||||
// .end(),
|
||||
//
|
||||
// 'navigate to default': (browser: NBrowser) =>
|
||||
// browser
|
||||
// .goToDefaultProject()
|
||||
// .assert.urlEquals(`${BASE}/#/project/INBOX/tasks`)
|
||||
// .assert.containsText(WORK_CTX_TITLE, 'Inbox')
|
||||
// .end(),
|
||||
//
|
||||
// 'navigate to daily summary from project without error': (browser: NBrowser) =>
|
||||
// browser
|
||||
// // Go to project page
|
||||
// .goToDefaultProject()
|
||||
//
|
||||
// .click(READY_TO_WORK_BTN)
|
||||
//
|
||||
// // navigate to
|
||||
// .waitForElementVisible(FINISH_DAY_BTN)
|
||||
// .click(FINISH_DAY_BTN)
|
||||
//
|
||||
// .waitForElementPresent(DAILY_SUMMARY)
|
||||
// .assert.urlEquals(`${BASE}/#/project/INBOX/daily-summary`)
|
||||
// .assert.elementNotPresent(GLOBAL_ERROR_ALERT)
|
||||
// .end(),
|
||||
// };
|
||||
import { BASE } from '../e2e.const';
|
||||
import { NBrowser } from '../n-browser-interface';
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
|
||||
const SIDENAV = `side-nav`;
|
||||
const EXPAND_PROJECT_BTN = `${SIDENAV} .expand-btn:first-of-type`;
|
||||
const CREATE_PROJECT_BTN = `${SIDENAV} section.projects .mat-mdc-menu-item:last-of-type`;
|
||||
|
||||
const PROJECT_NAME_INPUT = `dialog-create-project input:first-of-type`;
|
||||
const SUBMIT_BTN = `dialog-create-project button[type=submit]:enabled`;
|
||||
|
||||
const PROJECT = `${SIDENAV} section.projects .project`;
|
||||
const DEFAULT_PROJECT = `${PROJECT}:nth-of-type(1)`;
|
||||
const DEFAULT_PROJECT_BTN = `${DEFAULT_PROJECT} .mat-mdc-menu-item`;
|
||||
const DEFAULT_PROJECT_ADV_BTN = `${DEFAULT_PROJECT} .project-settings-btn`;
|
||||
|
||||
const WORK_CTX_MENU = `work-context-menu`;
|
||||
const WORK_CTX_TITLE = `.current-work-context-title`;
|
||||
|
||||
const PROJECT_SETTINGS_BTN = `${WORK_CTX_MENU} button:last-of-type`;
|
||||
const SECOND_PROJECT = `${PROJECT}:nth-of-type(2)`;
|
||||
const SECOND_PROJECT_BTN = `${SECOND_PROJECT} button:first-of-type`;
|
||||
|
||||
// const BACKLOG = `.backlog`;
|
||||
// const SPLIT = `split`;
|
||||
const FINISH_DAY_BTN = 'button[routerlink="/active/daily-summary"]';
|
||||
const READY_TO_WORK_BTN = '.ready-to-work-btn';
|
||||
const DAILY_SUMMARY = 'daily-summary';
|
||||
const GLOBAL_ERROR_ALERT = '.global-error-alert';
|
||||
|
||||
module.exports = {
|
||||
'@tags': ['project'],
|
||||
|
||||
'navigate to project settings': (browser: NBrowser) =>
|
||||
browser
|
||||
.loadAppAndClickAwayWelcomeDialog()
|
||||
.waitForElementVisible(EXPAND_PROJECT_BTN)
|
||||
.click(EXPAND_PROJECT_BTN)
|
||||
.waitForElementVisible(DEFAULT_PROJECT)
|
||||
.waitForElementVisible(DEFAULT_PROJECT_BTN)
|
||||
.moveToElement(DEFAULT_PROJECT_BTN, 20, 20)
|
||||
.waitForElementVisible(DEFAULT_PROJECT_ADV_BTN)
|
||||
.click(DEFAULT_PROJECT_ADV_BTN)
|
||||
.waitForElementVisible(WORK_CTX_MENU)
|
||||
.waitForElementVisible(PROJECT_SETTINGS_BTN)
|
||||
|
||||
// navigate to
|
||||
.click(PROJECT_SETTINGS_BTN)
|
||||
|
||||
.waitForElementVisible('.component-wrapper .mat-h1')
|
||||
.assert.textContains('.component-wrapper .mat-h1', 'Project Specific Settings')
|
||||
.end(),
|
||||
|
||||
'create project': (browser: NBrowser) =>
|
||||
browser
|
||||
.loadAppAndClickAwayWelcomeDialog()
|
||||
.waitForElementVisible(EXPAND_PROJECT_BTN)
|
||||
.click(EXPAND_PROJECT_BTN)
|
||||
.waitForElementVisible(CREATE_PROJECT_BTN)
|
||||
.click(CREATE_PROJECT_BTN)
|
||||
.waitForElementVisible(PROJECT_NAME_INPUT)
|
||||
.setValue(PROJECT_NAME_INPUT, 'Cool Test Project')
|
||||
.click(SUBMIT_BTN)
|
||||
|
||||
.waitForElementVisible(SECOND_PROJECT)
|
||||
.assert.elementPresent(SECOND_PROJECT)
|
||||
.assert.textContains(SECOND_PROJECT, 'Cool Test Project')
|
||||
|
||||
// navigate to
|
||||
.waitForElementVisible(SECOND_PROJECT_BTN)
|
||||
.click(SECOND_PROJECT_BTN)
|
||||
|
||||
// .waitForElementVisible(BACKLOG)
|
||||
// .waitForElementVisible(SPLIT)
|
||||
.assert.textContains(WORK_CTX_TITLE, 'Cool Test Project')
|
||||
.end(),
|
||||
|
||||
'navigate to default': (browser: NBrowser) =>
|
||||
browser
|
||||
.goToDefaultProject()
|
||||
.assert.urlEquals(`${BASE}/#/project/INBOX/tasks`)
|
||||
.assert.textContains(WORK_CTX_TITLE, 'Inbox')
|
||||
.end(),
|
||||
|
||||
'navigate to daily summary from project without error': (browser: NBrowser) =>
|
||||
browser
|
||||
// Go to project page
|
||||
.goToDefaultProject()
|
||||
|
||||
.click(READY_TO_WORK_BTN)
|
||||
|
||||
// navigate to
|
||||
.waitForElementVisible(FINISH_DAY_BTN)
|
||||
.click(FINISH_DAY_BTN)
|
||||
|
||||
.waitForElementPresent(DAILY_SUMMARY)
|
||||
.assert.urlEquals(`${BASE}/#/project/INBOX/daily-summary`)
|
||||
.assert.not.elementPresent(GLOBAL_ERROR_ALERT)
|
||||
.end(),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,57 +1,57 @@
|
|||
// import { BASE } from '../e2e.const';
|
||||
// import { NBrowser } from '../n-browser-interface';
|
||||
// /* eslint-disable @typescript-eslint/naming-convention */
|
||||
//
|
||||
// const WORK_VIEW_URL = `${BASE}/`;
|
||||
//
|
||||
// const TASK = 'task';
|
||||
// const TASK_2 = `${TASK}:nth-of-type(1)`;
|
||||
// const READY_TO_WORK_BTN = '.ready-to-work-btn';
|
||||
// const TASK_SCHEDULE_BTN = '.mat-icon-button.schedule-btn';
|
||||
// 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_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)`;
|
||||
//
|
||||
// module.exports = {
|
||||
// '@tags': ['task', 'reminder'],
|
||||
//
|
||||
// 'should add a scheduled tasks': (browser: NBrowser) =>
|
||||
// browser
|
||||
// .loadAppAndClickAwayWelcomeDialog(WORK_VIEW_URL)
|
||||
// .waitForElementPresent(READY_TO_WORK_BTN)
|
||||
// .addTaskWithReminder({ title: '0 test task koko', scheduleTime: Date.now() })
|
||||
// .waitForElementVisible(TASK)
|
||||
// .waitForElementVisible(TASK_SCHEDULE_BTN)
|
||||
// .assert.elementPresent(TASK_SCHEDULE_BTN)
|
||||
//
|
||||
// // Navigate to scheduled page and check if entry is there
|
||||
// .click(SCHEDULE_ROUTE_BTN)
|
||||
// .waitForElementVisible(SCHEDULE_PAGE_CMP)
|
||||
// .waitForElementVisible(SCHEDULE_PAGE_TASK_1)
|
||||
// .assert.containsText(SCHEDULE_PAGE_TASK_1, '0 test task koko')
|
||||
// .end(),
|
||||
//
|
||||
// 'should add multiple scheduled tasks': (browser: NBrowser) =>
|
||||
// browser
|
||||
// .loadAppAndClickAwayWelcomeDialog(WORK_VIEW_URL)
|
||||
// .waitForElementPresent(READY_TO_WORK_BTN)
|
||||
// .addTaskWithReminder({ title: '0 test task koko', taskSel: TASK })
|
||||
// .addTaskWithReminder({ title: '2 hihihi', taskSel: TASK_2 })
|
||||
// .waitForElementVisible(TASK)
|
||||
// .waitForElementVisible(TASK_SCHEDULE_BTN)
|
||||
// .assert.elementPresent(TASK_SCHEDULE_BTN)
|
||||
// .assert.elementPresent(TASK_SCHEDULE_BTN_2)
|
||||
//
|
||||
// // Navigate to scheduled page and check if entry is there
|
||||
// .click(SCHEDULE_ROUTE_BTN)
|
||||
// .waitForElementVisible(SCHEDULE_PAGE_CMP)
|
||||
// .waitForElementVisible(SCHEDULE_PAGE_TASK_1)
|
||||
// .assert.containsText(SCHEDULE_PAGE_TASK_1, '0 test task koko')
|
||||
// .assert.containsText(SCHEDULE_PAGE_TASK_2, '2 hihihi')
|
||||
// .end(),
|
||||
// };
|
||||
import { BASE } from '../e2e.const';
|
||||
import { NBrowser } from '../n-browser-interface';
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
|
||||
const WORK_VIEW_URL = `${BASE}/`;
|
||||
|
||||
const TASK = 'task';
|
||||
const TASK_2 = `${TASK}:nth-of-type(1)`;
|
||||
const READY_TO_WORK_BTN = '.ready-to-work-btn';
|
||||
const TASK_SCHEDULE_BTN = '.ico-btn.schedule-btn';
|
||||
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_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)`;
|
||||
|
||||
module.exports = {
|
||||
'@tags': ['task', 'reminder'],
|
||||
|
||||
'should add a scheduled tasks': (browser: NBrowser) =>
|
||||
browser
|
||||
.loadAppAndClickAwayWelcomeDialog(WORK_VIEW_URL)
|
||||
.waitForElementPresent(READY_TO_WORK_BTN)
|
||||
.addTaskWithReminder({ title: '0 test task koko', scheduleTime: Date.now() })
|
||||
.waitForElementVisible(TASK)
|
||||
.waitForElementVisible(TASK_SCHEDULE_BTN)
|
||||
.assert.elementPresent(TASK_SCHEDULE_BTN)
|
||||
|
||||
// Navigate to scheduled page and check if entry is there
|
||||
.click(SCHEDULE_ROUTE_BTN)
|
||||
.waitForElementVisible(SCHEDULE_PAGE_CMP)
|
||||
.waitForElementVisible(SCHEDULE_PAGE_TASK_1)
|
||||
.assert.textContains(SCHEDULE_PAGE_TASK_1, '0 test task koko')
|
||||
.end(),
|
||||
|
||||
'should add multiple scheduled tasks': (browser: NBrowser) =>
|
||||
browser
|
||||
.loadAppAndClickAwayWelcomeDialog(WORK_VIEW_URL)
|
||||
.waitForElementPresent(READY_TO_WORK_BTN)
|
||||
.addTaskWithReminder({ title: '0 test task koko', taskSel: TASK })
|
||||
.addTaskWithReminder({ title: '2 hihihi', taskSel: TASK_2 })
|
||||
.waitForElementVisible(TASK)
|
||||
.waitForElementVisible(TASK_SCHEDULE_BTN)
|
||||
.assert.elementPresent(TASK_SCHEDULE_BTN)
|
||||
.assert.elementPresent(TASK_SCHEDULE_BTN_2)
|
||||
|
||||
// Navigate to scheduled page and check if entry is there
|
||||
.click(SCHEDULE_ROUTE_BTN)
|
||||
.waitForElementVisible(SCHEDULE_PAGE_CMP)
|
||||
.waitForElementVisible(SCHEDULE_PAGE_TASK_1)
|
||||
.assert.textContains(SCHEDULE_PAGE_TASK_1, '0 test task koko')
|
||||
.assert.textContains(SCHEDULE_PAGE_TASK_2, '2 hihihi')
|
||||
.end(),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,91 +1,91 @@
|
|||
// import { BASE } from '../e2e.const';
|
||||
// import { NBrowser } from '../n-browser-interface';
|
||||
// /* eslint-disable @typescript-eslint/naming-convention */
|
||||
//
|
||||
// const WORK_VIEW_URL = `${BASE}/`;
|
||||
//
|
||||
// const DIALOG = 'dialog-view-task-reminder';
|
||||
// const DIALOG_TASKS_WRAPPER = `${DIALOG} .tasks`;
|
||||
//
|
||||
// const DIALOG_TASK = `${DIALOG} .task`;
|
||||
// const DIALOG_TASK1 = `${DIALOG_TASK}:first-of-type`;
|
||||
// const DIALOG_TASK2 = `${DIALOG_TASK}:nth-of-type(2)`;
|
||||
// const DIALOG_TASK3 = `${DIALOG_TASK}:nth-of-type(3)`;
|
||||
// const TO_TODAY_SUF = ' .actions button:last-of-type';
|
||||
//
|
||||
// const D_ACTIONS = `${DIALOG} mat-dialog-actions`;
|
||||
// const D_PLAY = `${D_ACTIONS} button:last-of-type`;
|
||||
//
|
||||
// const TODAY_TASKS = 'task-list task';
|
||||
// const TODAY_TASK_1 = `${TODAY_TASKS}:first-of-type`;
|
||||
//
|
||||
// const SCHEDULE_MAX_WAIT_TIME = 180000;
|
||||
//
|
||||
// module.exports = {
|
||||
// '@tags': ['task', 'reminder', 'schedule'],
|
||||
//
|
||||
// 'should display a modal with a scheduled task if due': (browser: NBrowser) =>
|
||||
// browser
|
||||
// .loadAppAndClickAwayWelcomeDialog(WORK_VIEW_URL)
|
||||
// .addTaskWithReminder({ title: '0 A task', scheduleTime: Date.now() })
|
||||
// .waitForElementVisible(DIALOG, SCHEDULE_MAX_WAIT_TIME)
|
||||
// .assert.elementPresent(DIALOG)
|
||||
// .waitForElementVisible(DIALOG_TASK1)
|
||||
// .assert.elementPresent(DIALOG_TASK1)
|
||||
// .assert.containsText(DIALOG_TASK1, '0 A task')
|
||||
// .end(),
|
||||
//
|
||||
// 'should display a modal with 2 scheduled task if due': (browser: NBrowser) => {
|
||||
// return (
|
||||
// browser
|
||||
// .loadAppAndClickAwayWelcomeDialog(WORK_VIEW_URL)
|
||||
// // NOTE: tasks are sorted by due time
|
||||
// .addTaskWithReminder({ title: '0 B task' })
|
||||
// .addTaskWithReminder({ title: '1 B task', scheduleTime: Date.now() })
|
||||
// .waitForElementVisible(DIALOG, SCHEDULE_MAX_WAIT_TIME)
|
||||
// .assert.elementPresent(DIALOG)
|
||||
// .waitForElementVisible(DIALOG_TASK1, SCHEDULE_MAX_WAIT_TIME)
|
||||
// .waitForElementVisible(DIALOG_TASK2, SCHEDULE_MAX_WAIT_TIME)
|
||||
// .assert.containsText(DIALOG_TASKS_WRAPPER, '0 B task')
|
||||
// .assert.containsText(DIALOG_TASKS_WRAPPER, '1 B task')
|
||||
// .end()
|
||||
// );
|
||||
// },
|
||||
//
|
||||
// 'should start single task': (browser: NBrowser) =>
|
||||
// browser
|
||||
// .loadAppAndClickAwayWelcomeDialog(WORK_VIEW_URL)
|
||||
// .addTaskWithReminder({ title: '0 C task', scheduleTime: Date.now() })
|
||||
// .waitForElementVisible(DIALOG, SCHEDULE_MAX_WAIT_TIME)
|
||||
// .waitForElementVisible(DIALOG_TASK1)
|
||||
// .click(D_PLAY)
|
||||
// .pause(100)
|
||||
// .assert.cssClassPresent(TODAY_TASK_1, 'isCurrent')
|
||||
// .end(),
|
||||
//
|
||||
// 'should manually empty list via add to today': (browser: NBrowser) => {
|
||||
// const start = Date.now() + 100000;
|
||||
// return (
|
||||
// browser
|
||||
// .loadAppAndClickAwayWelcomeDialog(WORK_VIEW_URL)
|
||||
// // NOTE: tasks are sorted by due time
|
||||
// .addTaskWithReminder({ title: '0 D task xyz', scheduleTime: start })
|
||||
// .addTaskWithReminder({ title: '1 D task xyz', scheduleTime: start })
|
||||
// .addTaskWithReminder({ title: '2 D task xyz', scheduleTime: Date.now() })
|
||||
// .waitForElementVisible(DIALOG, SCHEDULE_MAX_WAIT_TIME + 120000)
|
||||
// // wait for all tasks to be present
|
||||
// .waitForElementVisible(DIALOG_TASK1, SCHEDULE_MAX_WAIT_TIME + 120000)
|
||||
// .waitForElementVisible(DIALOG_TASK2, SCHEDULE_MAX_WAIT_TIME + 120000)
|
||||
// .waitForElementVisible(DIALOG_TASK3, SCHEDULE_MAX_WAIT_TIME + 120000)
|
||||
// .pause(100)
|
||||
// .assert.containsText(DIALOG_TASKS_WRAPPER, '0 D task xyz')
|
||||
// .assert.containsText(DIALOG_TASKS_WRAPPER, '1 D task xyz')
|
||||
// .assert.containsText(DIALOG_TASKS_WRAPPER, '2 D task xyz')
|
||||
// .click(DIALOG_TASK1 + TO_TODAY_SUF)
|
||||
// .click(DIALOG_TASK2 + TO_TODAY_SUF)
|
||||
// .pause(50)
|
||||
// .assert.containsText(DIALOG_TASK1, 'D task xyz')
|
||||
// .end()
|
||||
// );
|
||||
// },
|
||||
// };
|
||||
import { BASE } from '../e2e.const';
|
||||
import { NBrowser } from '../n-browser-interface';
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
|
||||
const WORK_VIEW_URL = `${BASE}/`;
|
||||
|
||||
const DIALOG = 'dialog-view-task-reminder';
|
||||
const DIALOG_TASKS_WRAPPER = `${DIALOG} .tasks`;
|
||||
|
||||
const DIALOG_TASK = `${DIALOG} .task`;
|
||||
const DIALOG_TASK1 = `${DIALOG_TASK}:first-of-type`;
|
||||
const DIALOG_TASK2 = `${DIALOG_TASK}:nth-of-type(2)`;
|
||||
const DIALOG_TASK3 = `${DIALOG_TASK}:nth-of-type(3)`;
|
||||
const TO_TODAY_SUF = ' .actions button:last-of-type';
|
||||
|
||||
const D_ACTIONS = `${DIALOG} mat-dialog-actions`;
|
||||
const D_PLAY = `${D_ACTIONS} button:last-of-type`;
|
||||
|
||||
const TODAY_TASKS = 'task-list task';
|
||||
const TODAY_TASK_1 = `${TODAY_TASKS}:first-of-type`;
|
||||
|
||||
const SCHEDULE_MAX_WAIT_TIME = 180000;
|
||||
|
||||
module.exports = {
|
||||
'@tags': ['task', 'reminder', 'schedule'],
|
||||
|
||||
'should display a modal with a scheduled task if due': (browser: NBrowser) =>
|
||||
browser
|
||||
.loadAppAndClickAwayWelcomeDialog(WORK_VIEW_URL)
|
||||
.addTaskWithReminder({ title: '0 A task', scheduleTime: Date.now() })
|
||||
.waitForElementVisible(DIALOG, SCHEDULE_MAX_WAIT_TIME)
|
||||
.assert.elementPresent(DIALOG)
|
||||
.waitForElementVisible(DIALOG_TASK1)
|
||||
.assert.elementPresent(DIALOG_TASK1)
|
||||
.assert.textContains(DIALOG_TASK1, '0 A task')
|
||||
.end(),
|
||||
|
||||
'should display a modal with 2 scheduled task if due': (browser: NBrowser) => {
|
||||
return (
|
||||
browser
|
||||
.loadAppAndClickAwayWelcomeDialog(WORK_VIEW_URL)
|
||||
// NOTE: tasks are sorted by due time
|
||||
.addTaskWithReminder({ title: '0 B task' })
|
||||
.addTaskWithReminder({ title: '1 B task', scheduleTime: Date.now() })
|
||||
.waitForElementVisible(DIALOG, SCHEDULE_MAX_WAIT_TIME)
|
||||
.assert.elementPresent(DIALOG)
|
||||
.waitForElementVisible(DIALOG_TASK1, SCHEDULE_MAX_WAIT_TIME)
|
||||
.waitForElementVisible(DIALOG_TASK2, SCHEDULE_MAX_WAIT_TIME)
|
||||
.assert.textContains(DIALOG_TASKS_WRAPPER, '0 B task')
|
||||
.assert.textContains(DIALOG_TASKS_WRAPPER, '1 B task')
|
||||
.end()
|
||||
);
|
||||
},
|
||||
|
||||
'should start single task': (browser: NBrowser) =>
|
||||
browser
|
||||
.loadAppAndClickAwayWelcomeDialog(WORK_VIEW_URL)
|
||||
.addTaskWithReminder({ title: '0 C task', scheduleTime: Date.now() })
|
||||
.waitForElementVisible(DIALOG, SCHEDULE_MAX_WAIT_TIME)
|
||||
.waitForElementVisible(DIALOG_TASK1)
|
||||
.click(D_PLAY)
|
||||
.pause(100)
|
||||
.assert.hasClass(TODAY_TASK_1, 'isCurrent')
|
||||
.end(),
|
||||
|
||||
'should manually empty list via add to today': (browser: NBrowser) => {
|
||||
const start = Date.now() + 100000;
|
||||
return (
|
||||
browser
|
||||
.loadAppAndClickAwayWelcomeDialog(WORK_VIEW_URL)
|
||||
// NOTE: tasks are sorted by due time
|
||||
.addTaskWithReminder({ title: '0 D task xyz', scheduleTime: start })
|
||||
.addTaskWithReminder({ title: '1 D task xyz', scheduleTime: start })
|
||||
.addTaskWithReminder({ title: '2 D task xyz', scheduleTime: Date.now() })
|
||||
.waitForElementVisible(DIALOG, SCHEDULE_MAX_WAIT_TIME + 120000)
|
||||
// wait for all tasks to be present
|
||||
.waitForElementVisible(DIALOG_TASK1, SCHEDULE_MAX_WAIT_TIME + 120000)
|
||||
.waitForElementVisible(DIALOG_TASK2, SCHEDULE_MAX_WAIT_TIME + 120000)
|
||||
.waitForElementVisible(DIALOG_TASK3, SCHEDULE_MAX_WAIT_TIME + 120000)
|
||||
.pause(100)
|
||||
.assert.textContains(DIALOG_TASKS_WRAPPER, '0 D task xyz')
|
||||
.assert.textContains(DIALOG_TASKS_WRAPPER, '1 D task xyz')
|
||||
.assert.textContains(DIALOG_TASKS_WRAPPER, '2 D task xyz')
|
||||
.click(DIALOG_TASK1 + TO_TODAY_SUF)
|
||||
.click(DIALOG_TASK2 + TO_TODAY_SUF)
|
||||
.pause(50)
|
||||
.assert.textContains(DIALOG_TASK1, 'D task xyz')
|
||||
.end()
|
||||
);
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,22 +1,22 @@
|
|||
// import { BASE } from '../e2e.const';
|
||||
// import { NBrowser } from '../n-browser-interface';
|
||||
// /* eslint-disable @typescript-eslint/naming-convention */
|
||||
//
|
||||
// const TASK = 'task';
|
||||
// const TASK_TAGS = 'task tag';
|
||||
// const WORK_VIEW_URL = `${BASE}/`;
|
||||
// const READY_TO_WORK_BTN = '.ready-to-work-btn';
|
||||
//
|
||||
// module.exports = {
|
||||
// '@tags': ['work-view', 'task', 'short-syntax'],
|
||||
//
|
||||
// 'should add task with project via short syntax': (browser: NBrowser) =>
|
||||
// browser
|
||||
// .loadAppAndClickAwayWelcomeDialog(WORK_VIEW_URL)
|
||||
// .waitForElementVisible(READY_TO_WORK_BTN)
|
||||
// .addTask('0 test task koko +i')
|
||||
// .waitForElementVisible(TASK)
|
||||
// .assert.visible(TASK)
|
||||
// .assert.containsText(TASK_TAGS, 'Inbox')
|
||||
// .end(),
|
||||
// };
|
||||
import { BASE } from '../e2e.const';
|
||||
import { NBrowser } from '../n-browser-interface';
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
|
||||
const TASK = 'task';
|
||||
const TASK_TAGS = 'task tag';
|
||||
const WORK_VIEW_URL = `${BASE}/`;
|
||||
const READY_TO_WORK_BTN = '.ready-to-work-btn';
|
||||
|
||||
module.exports = {
|
||||
'@tags': ['work-view', 'task', 'short-syntax'],
|
||||
|
||||
'should add task with project via short syntax': (browser: NBrowser) =>
|
||||
browser
|
||||
.loadAppAndClickAwayWelcomeDialog(WORK_VIEW_URL)
|
||||
.waitForElementVisible(READY_TO_WORK_BTN)
|
||||
.addTask('0 test task koko +i')
|
||||
.waitForElementVisible(TASK)
|
||||
.assert.visible(TASK)
|
||||
.assert.containsText(TASK_TAGS, 'Inbox')
|
||||
.end(),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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'",
|
||||
"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: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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue