-
Notifications
You must be signed in to change notification settings - Fork 4k
Expand file tree
/
Copy pathOverviewPage.js
More file actions
40 lines (31 loc) · 1.35 KB
/
OverviewPage.js
File metadata and controls
40 lines (31 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const { By, Key, until, Builder } = require('selenium-webdriver')
const BasePage = require('./BasePage')
const UPLOAD_DEFINITIONS_SECTION = By.css('div#upload-definitions-section')
const CHOOSE_BROKER_UPLOAD_FILE = By.css('input[name="file"]')
const UPLOAD_BROKER_FILE = By.css('input[type=submit][name="upload-definitions"]')
const POP_UP = By.css('div.form-popup-info')
const DOWNLOAD_DEFINITIONS_SECTION = By.css('div#download-definitions-section')
const CHOOSE_BROKER_DOWNLOAD_FILE = By.css('input#download-filename')
const DOWNLOAD_BROKER_FILE = By.css('button#upload-definitions')
const TOTALS_SECTION = By.css('div#main div#totals-section')
module.exports = class OverviewPage extends BasePage {
async uploadBrokerDefinitions(file) {
await this.click(UPLOAD_DEFINITIONS_SECTION)
await this.chooseFile(CHOOSE_BROKER_UPLOAD_FILE, file)
await this.driver.sleep(1000)
await this.click(UPLOAD_BROKER_FILE)
await this.acceptAlert()
let popup = await this.waitForDisplayed(POP_UP)
await this.click(POP_UP)
return popup.getText()
}
async downloadBrokerDefinitions(filename) {
return this.click(DOWNLOAD_DEFINITIONS_SECTION)
}
async ensureTotalsSectionIsVisible() {
return this.ensureSectionIsVisible(TOTALS_SECTION)
}
async ensureTotalsSectionIsInvisible() {
return this.ensureSectionIsInvisible(TOTALS_SECTION)
}
}