Skip to content

Commit b02141b

Browse files
committed
frontend: fix tests.
1 parent 3365793 commit b02141b

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

frontend/pre-test/registration.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ test('register', async ({ page }) => {
1010
await page.getByRole('textbox', { name: 'Email-address' }).fill(testUser1Email);
1111
await page.getByPlaceholder('John Doe').click();
1212
await page.getByPlaceholder('John Doe').fill(testUserName1);
13-
await page.getByRole('textbox', { name: 'Password' }).click();
14-
await page.getByRole('textbox', { name: 'Password' }).fill(testPassword1);
13+
await page.getByRole('textbox', { name: 'Password', exact: true }).fill(testPassword1);
14+
await page.getByRole('textbox', { name: 'Confirm password' }).fill(testPassword1);
1515
await page.getByText('I have read, understood and I am accepting the privacy notice.').click();
1616
await page.getByText('I have read, understood and I am accepting the terms and conditions.').click();
1717
await page.getByRole('button', { name: 'Register' }).click();

frontend/tests/basic.spec.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,16 @@ test('password change dialog validation', async ({ page }) => {
9797
await page.getByRole('button', { name: 'Change password' }).click();
9898

9999
await page.getByLabel('Current password').fill(testPassword1);
100-
await page.getByLabel('New password').fill('weak');
100+
await page.getByRole('textbox', { name: 'New password', exact: true }).fill('weak');
101101
await page.getByRole('dialog').getByRole('button', { name: 'Change password' }).click();
102102
await expect(page.getByText('Must contain at least one')).toBeVisible();
103103

104104
await page.getByLabel('Current password').clear();
105105
await page.getByLabel('Current password').fill('wrong_password');
106-
await page.getByLabel('New password').clear();
107-
await page.getByLabel('New password').fill('ValidPassword123!');
106+
await page.getByRole('textbox', { name: 'New password', exact: true }).clear();
107+
await page.getByRole('textbox', { name: 'New password', exact: true }).fill('ValidPassword123!');
108108
await page.getByRole('dialog').getByRole('button', { name: 'Change password' }).click();
109+
await expect(page.getByText('Passwords do not match')).toBeVisible();
109110
await page.getByRole('button', { name: 'Close' }).click();
110111
});
111112

@@ -223,7 +224,8 @@ test('change password', async ({page}) => {
223224
await page.getByRole('button', { name: 'Change password' }).click();
224225
await page.getByLabel('Current password').click();
225226
await page.getByLabel('Current password').fill(testPassword1);
226-
await page.getByLabel('New password').fill(testPassword2);
227+
await page.getByRole('textbox', { name: 'New password', exact: true }).fill(testPassword2);
228+
await page.getByRole('textbox', { name: 'Confirm new password' }).fill(testPassword2);
227229
await page.getByRole('dialog').getByRole('button', { name: 'Change password' }).click();
228230
await expect(page.getByText('LoginRegisterEmail-')).toBeVisible();
229231

0 commit comments

Comments
 (0)