test: fix flakiness in GH connection test case (#1383)

This commit is contained in:
QAComet
2023-10-25 03:04:04 -06:00
committed by GitHub
parent d82b50fcdb
commit 2fceaf2cf4
3 changed files with 13 additions and 8 deletions

View File

@@ -13,9 +13,9 @@ export class ApplicationsModal extends BasePage {
constructor (page) { constructor (page) {
super(page); super(page);
this.modal = page.getByTestId('add-app-connection-dialog'); this.modal = page.getByTestId('add-app-connection-dialog');
this.searchInput = page.getByTestId('search-for-app-text-field'); this.searchInput = this.modal.getByTestId('search-for-app-text-field');
this.appListItem = page.getByTestId('app-list-item'); this.appListItem = this.modal.getByTestId('app-list-item');
this.appLoader = page.getByTestId('search-for-app-loader'); this.appLoader = this.modal.getByTestId('search-for-app-loader');
} }
/** /**

View File

@@ -9,7 +9,7 @@ test('Github OAuth integration', async ({ page, applicationsPage }) => {
await page.waitForURL('/apps'); await page.waitForURL('/apps');
} }
const connectionModal = await applicationsPage.openAddConnectionModal(); const connectionModal = await applicationsPage.openAddConnectionModal();
expect(connectionModal.modal).toBeVisible(); await expect(connectionModal.modal).toBeVisible();
return await connectionModal.selectLink('github'); return await connectionModal.selectLink('github');
} }
); );
@@ -18,7 +18,7 @@ test('Github OAuth integration', async ({ page, applicationsPage }) => {
'Ensure the github connection modal is visible', 'Ensure the github connection modal is visible',
async () => { async () => {
const connectionModal = githubConnectionPage.addConnectionModal; const connectionModal = githubConnectionPage.addConnectionModal;
expect(connectionModal.modal).toBeVisible(); await expect(connectionModal.modal).toBeVisible();
return connectionModal; return connectionModal;
} }
); );
@@ -35,9 +35,9 @@ test('Github OAuth integration', async ({ page, applicationsPage }) => {
); );
await test.step('Ensure github popup is not a 404', async () => { await test.step('Ensure github popup is not a 404', async () => {
// expect(githubPopup).toBeVisible(); // await expect(githubPopup).toBeVisible();
const title = await githubPopup.title(); const title = await githubPopup.title();
expect(title).not.toMatch(/^Page not found/); await expect(title).not.toMatch(/^Page not found/);
}); });
/* Skip these in CI /* Skip these in CI

View File

@@ -74,7 +74,12 @@ export default function AddNewAppConnection(
}, []); }, []);
return ( return (
<Dialog open={true} onClose={onClose} maxWidth="sm" fullWidth> <Dialog
open={true}
onClose={onClose}
maxWidth="sm"
fullWidth
data-test="add-app-connection-dialog">
<DialogTitle>{formatMessage('apps.addNewAppConnection')}</DialogTitle> <DialogTitle>{formatMessage('apps.addNewAppConnection')}</DialogTitle>
<Box px={3}> <Box px={3}>