mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-08-01 04:01:01 +00:00
29 lines
785 B
TypeScript
29 lines
785 B
TypeScript
import { NightwatchBrowser } from 'nightwatch';
|
|
|
|
const ADD_NOTE_BTN = '#add-note-btn';
|
|
const TEXTAREA = 'dialog-fullscreen-markdown textarea';
|
|
// const ADD_NOTE_SUBMIT_BTN = 'dialog-add-note button[type=submit]:enabled';
|
|
const ADD_NOTE_SUBMIT_BTN = '#T-save-note';
|
|
const NOTES_WRAPPER = 'notes';
|
|
const ROUTER_WRAPPER = '.route-wrapper';
|
|
|
|
module.exports = {
|
|
async command(this: NightwatchBrowser, noteName: string) {
|
|
return (
|
|
this
|
|
//
|
|
.waitForElementVisible(ROUTER_WRAPPER)
|
|
.setValue('body', 'N')
|
|
|
|
.waitForElementVisible(ADD_NOTE_BTN)
|
|
|
|
.click(ADD_NOTE_BTN)
|
|
|
|
.waitForElementVisible(TEXTAREA)
|
|
.setValue(TEXTAREA, noteName)
|
|
|
|
.click(ADD_NOTE_SUBMIT_BTN)
|
|
.moveToElement(NOTES_WRAPPER, 10, 50)
|
|
);
|
|
},
|
|
};
|