From 857e4a2c02e13c1c4b1be310a33f687489781e94 Mon Sep 17 00:00:00 2001 From: m5r Date: Tue, 15 Oct 2024 15:23:19 +0200 Subject: [PATCH] Revert "chore: update upgrade e2e (#9494)" This reverts commit 7a0ef966656ecce5a4e7e4f30ed7f3590edd3852. --- tests/e2e/upgrade/upgrade.wdio-spec.js | 33 ++++++++++++++++---------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/tests/e2e/upgrade/upgrade.wdio-spec.js b/tests/e2e/upgrade/upgrade.wdio-spec.js index 6891d0204f..efb0e1c617 100644 --- a/tests/e2e/upgrade/upgrade.wdio-spec.js +++ b/tests/e2e/upgrade/upgrade.wdio-spec.js @@ -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 }); @@ -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({ @@ -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; }); @@ -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)} (`; @@ -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();