2018-07-31 12:04:45 -05:00
|
|
|
const ui = require('./spectronInterfaces.js');
|
|
|
|
|
|
|
|
class WebActions {
|
|
|
|
constructor(app) {
|
2018-08-02 05:23:46 -05:00
|
|
|
this.app = app;
|
|
|
|
}
|
2018-08-01 04:13:57 -05:00
|
|
|
|
2018-08-02 05:23:46 -05:00
|
|
|
async clickMaximizeButton() {
|
2018-07-31 12:04:45 -05:00
|
|
|
await this.app.client.waitForVisible(ui.MAXIMIZE_BTN, 10000).click(ui.MAXIMIZE_BTN);
|
|
|
|
}
|
|
|
|
|
|
|
|
async maximizeWindows() {
|
|
|
|
await this.clickMaximizeButton();
|
|
|
|
await this.app.browserWindow.isMaximized().then(function (maximized) {
|
|
|
|
expect(maximized).toBeTruthy();
|
|
|
|
})
|
|
|
|
}
|
2018-08-01 04:13:57 -05:00
|
|
|
|
2018-08-01 09:50:48 -05:00
|
|
|
async clickMinimizeButton(){
|
|
|
|
await this.app.client.waitForVisible(ui.MINIMIZE_BTN, 10000).click(ui.MINIMIZE_BTN);
|
2018-08-01 04:13:57 -05:00
|
|
|
}
|
|
|
|
|
2018-08-01 09:50:48 -05:00
|
|
|
async minimizeWindows() {
|
|
|
|
await this.clickMinimizeButton();
|
|
|
|
await this.app.browserWindow.isMinimized().then(function (isMinimized) {
|
|
|
|
expect(isMinimized).toBeTruthy();
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
async openApplicationMenuByClick() {
|
|
|
|
await this.app.client.click(ui.MAIN_MENU_ITEM);
|
|
|
|
}
|
|
|
|
|
2018-08-01 04:13:57 -05:00
|
|
|
async closeWindowByClick() {
|
|
|
|
await this.app.client.click(ui.CLOSE_BUTTON);
|
|
|
|
}
|
|
|
|
|
|
|
|
async openApplicationMenuByClick() {
|
|
|
|
await this.app.client.click(ui.MAIN_MENU_ITEM);
|
|
|
|
}
|
2018-07-31 12:04:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = WebActions;
|