Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ public boolean isSocialButtonPresent(String alias) {
return !driver.driver().findElements(By.id(id)).isEmpty();
}

public boolean isUsernameInputPresent() {
return !driver.driver().findElements(By.id("username")).isEmpty();
}

public boolean isPasswordInputPresent() {
return !driver.driver().findElements(By.id("password")).isEmpty();
}
Expand Down Expand Up @@ -140,4 +144,24 @@ public boolean isRememberMeCheckboxPresent() {
return false;
}
}

public boolean isSwitchOrganizationPresent() {
return !driver.driver().findElements(By.id("switch-organization")).isEmpty();
}

public void clickSwitchOrganization() {
driver.findElement(By.id("switch-organization")).click();
}

public void clickResetLogin() {
driver.findElement(By.id("reset-login")).click();
}

public boolean isTryAnotherWayPresent() {
return !driver.driver().findElements(By.id("try-another-way")).isEmpty();
}

public void clickTryAnotherWay() {
driver.findElement(By.id("try-another-way")).click();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,22 +105,22 @@ protected OrganizationRepresentation createOrganization(ManagedRealm managedReal
}
managedRealm.admin().identityProviders().create(broker).close();

String brokerAlias = broker.getAlias();
managedRealm.cleanup().add(r -> {
try {
r.identityProviders().get(brokerAlias).remove();
} catch (NotFoundException ignored) {}
});

managedRealm.admin().organizations().get(id).identityProviders().addIdentityProvider(broker.getAlias()).close();
org = managedRealm.admin().organizations().get(id).toRepresentation();

String orgId = id;
// org deletion must run before IdP removal — removing an IdP linked to an org may fail
managedRealm.cleanup().add(r -> {
try {
r.organizations().get(orgId).delete().close();
} catch (NotFoundException ignored) {}
});
String brokerAlias = broker.getAlias();
managedRealm.cleanup().add(r -> {
try {
r.identityProviders().get(brokerAlias).remove();
} catch (NotFoundException ignored) {}
});

return org;
}
Expand Down Expand Up @@ -175,7 +175,11 @@ protected MemberRepresentation addMember(OrganizationResource organization, Stri
}

String userId = expected.getId();
realm.cleanup().add(r -> r.users().get(userId).remove());
realm.cleanup().add(r -> {
try {
r.users().get(userId).remove();
} catch (NotFoundException ignored) {}
});

try (Response response = organization.members().addMember(userId)) {
assertEquals(Status.CREATED.getStatusCode(), response.getStatus());
Expand Down
Loading
Loading