-
-
Notifications
You must be signed in to change notification settings - Fork 204
/
upgrade.wdio.page.js
55 lines (47 loc) · 1.65 KB
/
upgrade.wdio.page.js
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
const common = require('../default/common/common.wdio.page');
const utils = require('../../utils');
const cancelUpgradeButton = () => $('button*=Cancel');
const deploymentInProgress = () => $('legend*=Deployment in progress');
const deploymentComplete = () => $('div*=Deployment complete');
const getInstallButton = async (branch, tag) => {
const element = tag ? await $(`span=${tag}`) : await $(`span*=${branch} (`);
const parent = await (await element.parentElement()).parentElement();
return await parent.$('.btn-primary');
};
const goToUpgradePage = async () => {
await browser.url('/admin/#/upgrade');
await common.waitForLoaders();
};
const expandPreReleasesAccordion = async () => {
const toggle = await $('.upgrade-accordion .accordion-toggle');
await toggle.waitForDisplayed();
await toggle.click();
// wait for accordion animation
await utils.delayPromise(500);
};
const upgradeModalConfirm = async () => {
const confirm = await $('.modal-footer .submit.btn');
await confirm.waitForDisplayed();
return confirm;
};
const getCurrentVersion = async () => {
const version = () => $('dl.horizontal dd');
await browser.waitUntil(async () => await (await version()).getText());
return await (await version()).getText();
};
const getBuild = async () => {
const version = () => $('dl.horizontal dd:nth-child(4)');
await browser.waitUntil(async () => await (await version()).getText());
return await (await version()).getText();
};
module.exports = {
cancelUpgradeButton,
deploymentInProgress,
deploymentComplete,
getCurrentVersion,
getInstallButton,
goToUpgradePage,
expandPreReleasesAccordion,
upgradeModalConfirm,
getBuild,
};