diff --git a/Frontend/src/setupTests.ts b/Frontend/src/setupTests.ts index a938e5c1..1ef80c40 100644 --- a/Frontend/src/setupTests.ts +++ b/Frontend/src/setupTests.ts @@ -27,7 +27,7 @@ jest.setTimeout(20_000); beforeAll(async () => { const options = new Chrome.Options(); - options.addArguments( 'headless', 'ignore-certificate-errors', '--disable-single-click-autofill'); + options.addArguments('headless', 'ignore-certificate-errors', '--disable-single-click-autofill'); options.setUserPreferences({ 'autofill.profile_enabled': false }); driver = await new Builder().forBrowser(Browser.CHROME).setChromeOptions(options).build(); await driver.manage().setTimeouts({ implicit: 2000 }); diff --git a/Frontend/src/tests/Settings.test.tsx b/Frontend/src/tests/Settings.test.tsx index 5051b027..5107e6ed 100644 --- a/Frontend/src/tests/Settings.test.tsx +++ b/Frontend/src/tests/Settings.test.tsx @@ -212,6 +212,7 @@ describe('test with logged in user', () => { test('user cannot delete account when entering wrong password', async () => { // ARRANGE + await driver.navigate().refresh(); await driver.wait(until.elementLocated(By.id('deleteAccountButton'))); const deleteAccountButton = await driver.findElement(By.id('deleteAccountButton')); await driver.wait(until.elementIsVisible(deleteAccountButton)); @@ -229,6 +230,7 @@ describe('test with logged in user', () => { // ASSERT const passwordDeleteMessage = await driver.findElement(By.id('passwordDeleteMessage')); + await driver.wait(until.elementTextMatches(passwordDeleteMessage, /.+/)); expect(await passwordDeleteMessage.getText()).toEqual('Invalid password.'); });