(e2e) sync keycloak users w/ backend users

The user full name was not the same, it would induce
flaky test, while the user name is updated at user
login from the KC data.
This commit is contained in:
Quentin BEY
2024-12-05 11:29:07 +01:00
committed by BEY Quentin
parent 514414de16
commit 99b6181944
5 changed files with 60 additions and 60 deletions

View File

@@ -233,8 +233,8 @@ def create_demo(stdout): # pylint: disable=too-many-locals
for role in models.RoleChoices.values:
team_user = models.User(
sub=uuid4(),
email=f"jean.team-{role}@example.com",
name=f"Jean Group {role.capitalize()}",
email=f"e2e.team-{role}@example.com",
name=f"E2E Group {role.capitalize()}",
password="!",
is_superuser=False,
is_active=True,
@@ -249,8 +249,8 @@ def create_demo(stdout): # pylint: disable=too-many-locals
for role in models.RoleChoices.values:
user_with_mail = models.User(
sub=uuid4(),
email=f"jean.mail-{role}@example.com",
name=f"Jean Mail {role.capitalize()}",
email=f"e2e.mail-{role}@example.com",
name=f"E2E Mail {role.capitalize()}",
password="!",
is_superuser=False,
is_active=True,
@@ -270,8 +270,8 @@ def create_demo(stdout): # pylint: disable=too-many-locals
for domain_role in models.RoleChoices.values:
team_mail_user = models.User(
sub=uuid4(),
email=f"jean.team-{team_role}-mail-{domain_role}@example.com",
name=f"Jean Group {team_role.capitalize()} Mail {domain_role.capitalize()}",
email=f"e2e.team-{team_role}-mail-{domain_role}@example.com",
name=f"E2E Group {team_role.capitalize()} Mail {domain_role.capitalize()}",
password="!",
is_superuser=False,
is_active=True,

View File

@@ -12,10 +12,10 @@ export const keyCloakSignIn = async (
});
const username = accountName
? `jean.${accountName}`
? `e2e.${accountName}`
: `user-e2e-${browserName}`;
const password = accountName
? `password-e2e-jean.${accountName}`
? `password-e2e.${accountName}`
: `password-e2e-${browserName}`;
if (title?.includes('Sign in to your account')) {

View File

@@ -17,7 +17,7 @@ test.describe('Members Delete', () => {
const table = page.getByLabel('List members card').getByRole('table');
const cells = table.getByRole('row').nth(1).getByRole('cell');
await expect(cells.nth(1)).toHaveText('Jean Group Member');
await expect(cells.nth(1)).toHaveText('E2E Group Member');
await cells.nth(4).getByLabel('Member options').click();
await page.getByLabel('Open the modal to delete this member').click();
@@ -137,7 +137,7 @@ test.describe('Members Delete', () => {
await createTeam(page, 'member-delete-6', browserName, 1);
// To not be the only owner
await addNewMember(page, 0, 'Owner', 'Jean');
await addNewMember(page, 0, 'Owner', 'E2E');
const username = await addNewMember(page, 0, 'Administration', 'Monique');