From d780ef2d0c5d19f3623becc82c8689db54c1cac6 Mon Sep 17 00:00:00 2001 From: mfrances Date: Fri, 7 May 2021 10:46:50 -0400 Subject: [PATCH 1/4] fixes identity provider cypress tests --- cypress/integration/identity_providers.spec.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/cypress/integration/identity_providers.spec.ts b/cypress/integration/identity_providers.spec.ts index 08e80f6780..031e86a7d4 100644 --- a/cypress/integration/identity_providers.spec.ts +++ b/cypress/integration/identity_providers.spec.ts @@ -24,7 +24,7 @@ describe("Identity provider test", () => { sidebarPage.goToIdentityProviders(); }); - /*it("should create provider", () => { + it("should create provider", () => { createProviderPage.checkGitHubCardVisible().clickGitHubCard(); createProviderPage.checkAddButtonDisabled(); @@ -59,6 +59,8 @@ describe("Identity provider test", () => { .clickCard("facebook") .fill("facebook", "123") .clickAdd(); + + sidebarPage.goToIdentityProviders(); listingPage.itemExist("facebook"); createProviderPage @@ -66,12 +68,19 @@ describe("Identity provider test", () => { .clickItem(identityProviderName) .fill(identityProviderName, "123") .clickAdd(); + + sidebarPage.goToIdentityProviders(); + listingPage.itemExist(identityProviderName); + createProviderPage .clickCreateDropdown() .clickItem("bitbucket") .fill("bitbucket", "123") .clickAdd(); + sidebarPage.goToIdentityProviders(); + listingPage.itemExist(identityProviderName); + orderDialog.openDialog().checkOrder(providers); orderDialog.moveRowTo("facebook", identityProviderName); @@ -81,7 +90,7 @@ describe("Identity provider test", () => { masthead.checkNotificationMessage( "Successfully changed display order of identity providers" ); - });*/ + }); it("should create a oidc provider using discovery url", () => { const oidcProviderName = "oidc"; @@ -114,10 +123,13 @@ describe("Identity provider test", () => { modalUtils.checkModalTitle("Delete provider?").confirmModal(); masthead.checkNotificationMessage("Provider successfully deleted"); - cy.wait(100); listingPage.deleteItem("github"); modalUtils.checkModalTitle("Delete provider?").confirmModal(); masthead.checkNotificationMessage("Provider successfully deleted"); + + listingPage.deleteItem("oidc"); + modalUtils.checkModalTitle("Delete provider?").confirmModal(); + masthead.checkNotificationMessage("Provider successfully deleted"); }); }); }); From 23d2d6b123b5b2b227381c1cb941e85e0e44f07f Mon Sep 17 00:00:00 2001 From: mfrances Date: Fri, 7 May 2021 14:42:59 -0400 Subject: [PATCH 2/4] rm scrollintoview --- cypress/support/pages/admin_console/SidebarPage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/pages/admin_console/SidebarPage.ts b/cypress/support/pages/admin_console/SidebarPage.ts index 90bdfe0457..7d22f195b3 100644 --- a/cypress/support/pages/admin_console/SidebarPage.ts +++ b/cypress/support/pages/admin_console/SidebarPage.ts @@ -90,7 +90,7 @@ export default class SidebarPage { } goToIdentityProviders() { - cy.get(this.identityProvidersBtn).scrollIntoView().click(); + cy.get(this.identityProvidersBtn).click(); return this; } From 12d36613831dfe03a787441ae7c418bf43161876 Mon Sep 17 00:00:00 2001 From: mfrances Date: Fri, 7 May 2021 15:56:44 -0400 Subject: [PATCH 3/4] temp rm cleanup --- .../integration/identity_providers.spec.ts | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/cypress/integration/identity_providers.spec.ts b/cypress/integration/identity_providers.spec.ts index 031e86a7d4..e202b7d753 100644 --- a/cypress/integration/identity_providers.spec.ts +++ b/cypress/integration/identity_providers.spec.ts @@ -113,23 +113,23 @@ describe("Identity provider test", () => { ); }); - it("clean up providers", () => { - const modalUtils = new ModalUtils(); - listingPage.deleteItem("bitbucket"); - modalUtils.checkModalTitle("Delete provider?").confirmModal(); - masthead.checkNotificationMessage("Provider successfully deleted"); + // it("clean up providers", () => { + // const modalUtils = new ModalUtils(); + // listingPage.deleteItem("bitbucket"); + // modalUtils.checkModalTitle("Delete provider?").confirmModal(); + // masthead.checkNotificationMessage("Provider successfully deleted"); - listingPage.deleteItem("facebook"); - modalUtils.checkModalTitle("Delete provider?").confirmModal(); - masthead.checkNotificationMessage("Provider successfully deleted"); + // listingPage.deleteItem("facebook"); + // modalUtils.checkModalTitle("Delete provider?").confirmModal(); + // masthead.checkNotificationMessage("Provider successfully deleted"); - listingPage.deleteItem("github"); - modalUtils.checkModalTitle("Delete provider?").confirmModal(); - masthead.checkNotificationMessage("Provider successfully deleted"); + // listingPage.deleteItem("github"); + // modalUtils.checkModalTitle("Delete provider?").confirmModal(); + // masthead.checkNotificationMessage("Provider successfully deleted"); - listingPage.deleteItem("oidc"); - modalUtils.checkModalTitle("Delete provider?").confirmModal(); - masthead.checkNotificationMessage("Provider successfully deleted"); - }); + // listingPage.deleteItem("oidc"); + // modalUtils.checkModalTitle("Delete provider?").confirmModal(); + // masthead.checkNotificationMessage("Provider successfully deleted"); + // }); }); }); From 9b607a30211c9f8d69f4b87a949b414a88c00551 Mon Sep 17 00:00:00 2001 From: mfrances Date: Fri, 7 May 2021 16:43:10 -0400 Subject: [PATCH 4/4] use alternate click than helpid --- cypress/integration/identity_providers.spec.ts | 3 +++ .../manage/identity_providers/CreateProviderPage.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cypress/integration/identity_providers.spec.ts b/cypress/integration/identity_providers.spec.ts index e202b7d753..7f8facc641 100644 --- a/cypress/integration/identity_providers.spec.ts +++ b/cypress/integration/identity_providers.spec.ts @@ -60,6 +60,7 @@ describe("Identity provider test", () => { .fill("facebook", "123") .clickAdd(); + cy.wait(2000); sidebarPage.goToIdentityProviders(); listingPage.itemExist("facebook"); @@ -69,6 +70,7 @@ describe("Identity provider test", () => { .fill(identityProviderName, "123") .clickAdd(); + cy.wait(2000); sidebarPage.goToIdentityProviders(); listingPage.itemExist(identityProviderName); @@ -78,6 +80,7 @@ describe("Identity provider test", () => { .fill("bitbucket", "123") .clickAdd(); + cy.wait(2000); sidebarPage.goToIdentityProviders(); listingPage.itemExist(identityProviderName); diff --git a/cypress/support/pages/admin_console/manage/identity_providers/CreateProviderPage.ts b/cypress/support/pages/admin_console/manage/identity_providers/CreateProviderPage.ts index b84c26607b..210b19c9ed 100644 --- a/cypress/support/pages/admin_console/manage/identity_providers/CreateProviderPage.ts +++ b/cypress/support/pages/admin_console/manage/identity_providers/CreateProviderPage.ts @@ -45,7 +45,7 @@ export default class CreateProviderPage { } clickCreateDropdown() { - cy.getId(this.addProviderDropdown, { timeout: 10000 }).click(); + cy.contains('Add provider').click(); return this; }