Fixed browser tests broken by onboarding changes (#19998)

ref 78311591d0

- updated tests to not click a button on the setup/done screen that is no longer shown
- fixed setup flow showing an alert bar due to not handling the `TransitionAborted` error that is thrown by the setup/done->dashboard redirect
This commit is contained in:
Kevin Ansfield 2024-04-08 15:15:04 +01:00 committed by GitHub
parent 78311591d0
commit 5c05ebe6cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 1 deletions

View File

@ -61,6 +61,11 @@ export default class SetupController extends Controller.extend(ValidationEngine)
return true;
} catch (error) {
// handle setup/done route redirecting to dashboard
if (error.message === 'TransitionAborted') {
return true;
}
if (error && error.payload && error.payload.errors) {
if (isVersionMismatchError(error)) {
return this.notifications.showAPIError(error);
@ -141,6 +146,11 @@ export default class SetupController extends Controller.extend(ValidationEngine)
let [apiError] = error.payload.errors;
this.set('flowErrors', [apiError.message, apiError.context].join(' '));
} else {
// ignore setup/done route redirecting to dashboard
if (error.message === 'TransitionAborted') {
return true;
}
// Connection errors don't return proper status message, only req.body
this.notifications.showAlert('There was a problem on the server.', {type: 'error', key: 'setup.authenticate.failed'});
}

View File

@ -60,7 +60,7 @@ const setupGhost = async (page) => {
await page.getByPlaceholder('At least 10 characters').fill(ownerUser.password);
await page.getByPlaceholder('At least 10 characters').press('Enter');
await page.locator('.gh-done-pink').click();
await page.locator('.gh-nav').waitFor(options);
}
};