Skip to content

Commit

Permalink
Revert "chore: update upgrade e2e (#9494)"
Browse files Browse the repository at this point in the history
This reverts commit 7a0ef96.
  • Loading branch information
m5r committed Oct 15, 2024
1 parent 4470796 commit 857e4a2
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions tests/e2e/upgrade/upgrade.wdio-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@ 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 });
await commonPage.logout();
await loginPage.login({ username: constants.USERNAME, password: constants.PASSWORD, adminApp: true });
return;
await loginPage.login({ username: docs.user.username, password: docs.user.password, loadPage: false });
await oldNavigationPage.goToBase();
await oldNavigationPage.logout();
}

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

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

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

const deployInfo = await utils.request({ path: '/api/deploy-info' });
expect(semver.valid(deployInfo.version)).to.be.ok;
});
Expand Down Expand Up @@ -114,15 +117,17 @@ 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 @@ -131,8 +136,12 @@ describe('Performing an upgrade', () => {
});

it('should display upgrade page even without upgrade logs', async () => {
await loginPage.login({ username: constants.USERNAME, password: constants.PASSWORD, adminApp: true });
if (testFrontend) {
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 857e4a2

Please sign in to comment.