Merge pull request #592 from mfrances17/fix-identity-tests

fixes identity provider cypress tests
This commit is contained in:
mfrances17 2021-05-07 17:21:47 -04:00 committed by GitHub
commit 40d004cdf1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 17 deletions

View file

@ -24,7 +24,7 @@ describe("Identity provider test", () => {
sidebarPage.goToIdentityProviders(); sidebarPage.goToIdentityProviders();
}); });
/*it("should create provider", () => { it("should create provider", () => {
createProviderPage.checkGitHubCardVisible().clickGitHubCard(); createProviderPage.checkGitHubCardVisible().clickGitHubCard();
createProviderPage.checkAddButtonDisabled(); createProviderPage.checkAddButtonDisabled();
@ -59,6 +59,9 @@ describe("Identity provider test", () => {
.clickCard("facebook") .clickCard("facebook")
.fill("facebook", "123") .fill("facebook", "123")
.clickAdd(); .clickAdd();
cy.wait(2000);
sidebarPage.goToIdentityProviders();
listingPage.itemExist("facebook"); listingPage.itemExist("facebook");
createProviderPage createProviderPage
@ -66,12 +69,21 @@ describe("Identity provider test", () => {
.clickItem(identityProviderName) .clickItem(identityProviderName)
.fill(identityProviderName, "123") .fill(identityProviderName, "123")
.clickAdd(); .clickAdd();
cy.wait(2000);
sidebarPage.goToIdentityProviders();
listingPage.itemExist(identityProviderName);
createProviderPage createProviderPage
.clickCreateDropdown() .clickCreateDropdown()
.clickItem("bitbucket") .clickItem("bitbucket")
.fill("bitbucket", "123") .fill("bitbucket", "123")
.clickAdd(); .clickAdd();
cy.wait(2000);
sidebarPage.goToIdentityProviders();
listingPage.itemExist(identityProviderName);
orderDialog.openDialog().checkOrder(providers); orderDialog.openDialog().checkOrder(providers);
orderDialog.moveRowTo("facebook", identityProviderName); orderDialog.moveRowTo("facebook", identityProviderName);
@ -81,7 +93,7 @@ describe("Identity provider test", () => {
masthead.checkNotificationMessage( masthead.checkNotificationMessage(
"Successfully changed display order of identity providers" "Successfully changed display order of identity providers"
); );
});*/ });
it("should create a oidc provider using discovery url", () => { it("should create a oidc provider using discovery url", () => {
const oidcProviderName = "oidc"; const oidcProviderName = "oidc";
@ -104,20 +116,23 @@ describe("Identity provider test", () => {
); );
}); });
it("clean up providers", () => { // it("clean up providers", () => {
const modalUtils = new ModalUtils(); // const modalUtils = new ModalUtils();
listingPage.deleteItem("bitbucket"); // listingPage.deleteItem("bitbucket");
modalUtils.checkModalTitle("Delete provider?").confirmModal(); // modalUtils.checkModalTitle("Delete provider?").confirmModal();
masthead.checkNotificationMessage("Provider successfully deleted"); // masthead.checkNotificationMessage("Provider successfully deleted");
listingPage.deleteItem("facebook"); // listingPage.deleteItem("facebook");
modalUtils.checkModalTitle("Delete provider?").confirmModal(); // modalUtils.checkModalTitle("Delete provider?").confirmModal();
masthead.checkNotificationMessage("Provider successfully deleted"); // masthead.checkNotificationMessage("Provider successfully deleted");
cy.wait(100); // listingPage.deleteItem("github");
listingPage.deleteItem("github"); // modalUtils.checkModalTitle("Delete provider?").confirmModal();
modalUtils.checkModalTitle("Delete provider?").confirmModal(); // masthead.checkNotificationMessage("Provider successfully deleted");
masthead.checkNotificationMessage("Provider successfully deleted");
}); // listingPage.deleteItem("oidc");
// modalUtils.checkModalTitle("Delete provider?").confirmModal();
// masthead.checkNotificationMessage("Provider successfully deleted");
// });
}); });
}); });

View file

@ -90,7 +90,7 @@ export default class SidebarPage {
} }
goToIdentityProviders() { goToIdentityProviders() {
cy.get(this.identityProvidersBtn).scrollIntoView().click(); cy.get(this.identityProvidersBtn).click();
return this; return this;
} }

View file

@ -45,7 +45,7 @@ export default class CreateProviderPage {
} }
clickCreateDropdown() { clickCreateDropdown() {
cy.getId(this.addProviderDropdown, { timeout: 10000 }).click(); cy.contains('Add provider').click();
return this; return this;
} }