rabbitmq-server/deps/rabbitmq_management/selenium/test/pageobjects/OverviewPage.js

43 lines
1.0 KiB
JavaScript
Raw Normal View History

const { By, Key, until, Builder } = require('selenium-webdriver')
const BasePage = require('./BasePage')
const MENU_TABS = By.css('div#menu ul#tabs')
const USER = By.css('li#logout')
const LOGOUT_FORM = By.css('li#logout form')
const CONNECTION_TAB = By.css('div#menu ul#tabs li a[href="#/connections"]')
const CHANNELS_TAB = By.css('div#menu ul#tabs li a[href="#/channels"]')
const QUEUES_TAB = By.css('div#menu ul#tabs li a[href="#/queues"]')
const ADMIN_TAB = By.css('div#menu ul#tabs li a[href="#/users"]')
2022-07-07 00:23:33 +08:00
module.exports = class OverviewPage extends BasePage {
async isLoaded () {
2022-07-06 23:38:45 +08:00
return await this.waitForDisplayed(MENU_TABS)
}
async logout () {
await this.submit(LOGOUT_FORM)
}
async getUser () {
return this.getText(USER)
}
async clickOnConnectionsTab () {
2022-07-07 00:23:33 +08:00
return this.click(CONNECTION_TAB)
}
async clickOnAdminTab () {
2022-07-07 00:23:33 +08:00
return this.click(ADMIN_TAB)
}
async clickOnChannelsTab () {
2022-07-07 00:23:33 +08:00
return this.click(CHANNELS_TAB)
}
async clickOnQueuesTab () {
2022-07-07 00:23:33 +08:00
return this.click(QUEUES_TAB)
}
}