fixes issue 376

This commit is contained in:
mfrances 2021-03-05 17:04:41 -05:00
parent 337efd1b3b
commit 50570e9f20
2 changed files with 20 additions and 3 deletions

View file

@ -56,7 +56,15 @@ describe("User Fed Kerberos tests", () => {
}); });
it("Create Kerberos provider from empty state", () => { it("Create Kerberos provider from empty state", () => {
providersPage.clickNewCard(provider); // if tests don't start at empty state, e.g. user has providers configured locally,
// create a new card from the card view instead
cy.get("body").then(($body) => {
if ($body.find(`[data-testid=kerberos-card]`).length > 0) {
providersPage.clickNewCard(provider);
} else {
providersPage.clickMenuCommand(addProviderMenu, initCapProvider);
}
});
providersPage.fillKerberosRequiredData( providersPage.fillKerberosRequiredData(
firstKerberosName, firstKerberosName,
firstKerberosRealm, firstKerberosRealm,

View file

@ -49,6 +49,7 @@ const newLdapDay = "Wednesday";
const newLdapHour = "15"; const newLdapHour = "15";
const newLdapMinute = "55"; const newLdapMinute = "55";
const addProviderMenu = "Add new provider";
const createdSuccessMessage = "User federation provider successfully created"; const createdSuccessMessage = "User federation provider successfully created";
const savedSuccessMessage = "User federation provider successfully saved"; const savedSuccessMessage = "User federation provider successfully saved";
const deletedSuccessMessage = "The user federation provider has been deleted."; const deletedSuccessMessage = "The user federation provider has been deleted.";
@ -72,7 +73,15 @@ describe("User Fed LDAP tests", () => {
}); });
it("Create Ldap provider from empty state", () => { it("Create Ldap provider from empty state", () => {
providersPage.clickNewCard("ldap"); // if tests don't start at empty state, e.g. user has providers configured locally,
// create a new card from the card view instead
cy.get("body").then(($body) => {
if ($body.find(`[data-testid=ldap-card]`).length > 0) {
providersPage.clickNewCard(provider);
} else {
providersPage.clickMenuCommand(addProviderMenu, allCapProvider);
}
});
providersPage.fillLdapRequiredGeneralData(firstLdapName, firstLdapVendor); providersPage.fillLdapRequiredGeneralData(firstLdapName, firstLdapVendor);
providersPage.fillLdapRequiredConnectionData( providersPage.fillLdapRequiredConnectionData(
connectionUrl, connectionUrl,
@ -159,7 +168,7 @@ describe("User Fed LDAP tests", () => {
}); });
it("Create new LDAP provider using the New Provider dropdown", () => { it("Create new LDAP provider using the New Provider dropdown", () => {
providersPage.clickMenuCommand("Add new provider", "LDAP"); providersPage.clickMenuCommand(addProviderMenu, allCapProvider);
providersPage.fillLdapRequiredGeneralData(secondLdapName, secondLdapVendor); providersPage.fillLdapRequiredGeneralData(secondLdapName, secondLdapVendor);
providersPage.fillLdapRequiredConnectionData( providersPage.fillLdapRequiredConnectionData(
connectionUrl, connectionUrl,