Skip to content

Commit

Permalink
chore: update upgrade e2e (#9494)
Browse files Browse the repository at this point in the history
  • Loading branch information
latin-panda authored Oct 4, 2024
1 parent 15d77e4 commit 7a0ef96
Showing 1 changed file with 12 additions and 21 deletions.
33 changes: 12 additions & 21 deletions tests/e2e/upgrade/upgrade.wdio-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ describe('Performing an upgrade', () => {
if (testFrontend) {
// a variety of selectors that we use in e2e tests to interact with webapp
// are not compatible with older versions of the app.
await loginPage.login({ username: docs.user.username, password: docs.user.password, loadPage: false });
await oldNavigationPage.goToBase();
await oldNavigationPage.logout();
await loginPage.login({ username: docs.user.username, password: docs.user.password });
await commonPage.logout();
await loginPage.login({ username: constants.USERNAME, password: constants.PASSWORD, adminApp: true });
return;
}

await loginPage.login({ username: constants.USERNAME, password: constants.PASSWORD, loadPage: false });
Expand All @@ -71,7 +72,7 @@ describe('Performing an upgrade', () => {
await utils.revertDb([/^form:/], true);
});

it('should have an upgrade_log after installing', async () => {
it('should have an upgrade_log after installing the app, without logs upgrade is aborted', async () => {
const logs = await getUpgradeLogs();
expect(logs.length).to.equal(1);
expect(logs[0]).to.include({
Expand All @@ -80,11 +81,7 @@ describe('Performing an upgrade', () => {
});
});

it('should have valid semver after installing', async () => {
if (!testFrontend) {
return;
}

(testFrontend ? it : xit)('should have valid semver after installing', async () => {
const deployInfo = await utils.request({ path: '/api/deploy-info' });
expect(semver.valid(deployInfo.version)).to.be.ok;
});
Expand Down Expand Up @@ -117,17 +114,15 @@ describe('Performing an upgrade', () => {
state: 'finalized',
});

if (!testFrontend) {
return;
}

await adminPage.logout();
await loginPage.login({ username: docs.user.username, password: docs.user.password, loadPage: false });
await oldNavigationPage.goToBase();
await oldNavigationPage.sync(true);
});

(testFrontend ? it : xit)('should display current branch in the about page', async () => {
await loginPage.login({ username: docs.user.username, password: docs.user.password });
await commonPage.sync(true);
await browser.refresh();
await commonPage.waitForPageLoaded();

await commonPage.goToAboutPage();
await (await aboutPage.aboutCard()).waitForDisplayed();
const expected = TAG || `${utils.escapeBranchName(BRANCH)} (`;
Expand All @@ -136,12 +131,8 @@ describe('Performing an upgrade', () => {
});

it('should display upgrade page even without upgrade logs', async () => {
if (testFrontend) {
await loginPage.login({ username: constants.USERNAME, password: constants.PASSWORD, adminApp: true });
}

await loginPage.login({ username: constants.USERNAME, password: constants.PASSWORD, adminApp: true });
await deleteUpgradeLogs();

await upgradePage.goToUpgradePage();

const currentVersion = await upgradePage.getCurrentVersion();
Expand Down

0 comments on commit 7a0ef96

Please sign in to comment.