2020-10-26 15:18:23 +03:00
|
|
|
import webdriver from 'selenium-webdriver';
|
|
|
|
|
|
|
|
export const delay = (time) =>
|
|
|
|
new Promise((resolve) => setTimeout(resolve, time));
|
|
|
|
|
|
|
|
export const switchMonitorTests = {
|
2021-08-27 19:08:40 +03:00
|
|
|
'should switch to Log Monitor': async function (driver) {
|
|
|
|
await driver
|
2021-06-20 06:08:00 +03:00
|
|
|
.findElement(webdriver.By.xpath('//button[text()="Inspector"]'))
|
2020-10-26 15:18:23 +03:00
|
|
|
.click();
|
|
|
|
await delay(500); // Wait till menu is fully opened
|
2021-08-27 19:08:40 +03:00
|
|
|
await driver
|
2021-06-20 06:08:00 +03:00
|
|
|
.findElement(webdriver.By.xpath('//button[text()="Log monitor"]'))
|
2020-10-26 15:18:23 +03:00
|
|
|
.click();
|
|
|
|
await delay(500);
|
2021-08-27 19:08:40 +03:00
|
|
|
await driver.findElement(
|
2021-06-20 06:08:00 +03:00
|
|
|
webdriver.By.xpath(
|
2023-07-12 21:03:20 +03:00
|
|
|
'//div[div[button[text()="Reset"]] and .//div[button[text()="Revert"]]]',
|
|
|
|
),
|
2020-10-26 15:18:23 +03:00
|
|
|
);
|
|
|
|
await delay(500);
|
|
|
|
},
|
|
|
|
|
2021-08-27 19:08:40 +03:00
|
|
|
'should switch to Chart Monitor': async function (driver) {
|
|
|
|
await driver
|
2021-06-20 06:08:00 +03:00
|
|
|
.findElement(webdriver.By.xpath('//button[text()="Log monitor"]'))
|
2020-10-26 15:18:23 +03:00
|
|
|
.click();
|
|
|
|
await delay(500); // Wait till menu is fully opened
|
2021-08-27 19:08:40 +03:00
|
|
|
await driver
|
2021-06-20 06:08:00 +03:00
|
|
|
.findElement(webdriver.By.xpath('//button[text()="Chart"]'))
|
2020-10-26 15:18:23 +03:00
|
|
|
.click();
|
|
|
|
await delay(500);
|
2021-08-27 19:08:40 +03:00
|
|
|
await driver.findElement(
|
2023-07-12 21:03:20 +03:00
|
|
|
webdriver.By.xpath('//*[@class="nodeText" and text()="state"]'),
|
2020-10-26 15:18:23 +03:00
|
|
|
);
|
|
|
|
await delay(500); // Wait till menu is closed
|
|
|
|
},
|
|
|
|
|
2021-08-27 19:08:40 +03:00
|
|
|
'should switch back to Inspector Monitor': async function (driver) {
|
|
|
|
await driver
|
2021-06-20 06:08:00 +03:00
|
|
|
.findElement(webdriver.By.xpath('//button[text()="Chart"]'))
|
2020-10-26 15:18:23 +03:00
|
|
|
.click();
|
|
|
|
await delay(1000); // Wait till menu is fully opened
|
2021-08-27 19:08:40 +03:00
|
|
|
await driver
|
2021-06-20 06:08:00 +03:00
|
|
|
.findElement(webdriver.By.xpath('//button[text()="Inspector"]'))
|
2020-10-26 15:18:23 +03:00
|
|
|
.click();
|
|
|
|
await delay(1500); // Wait till menu is closed
|
|
|
|
},
|
|
|
|
};
|