fix identity test (#21312)

* fix identity test

* crazy that this fixes it
This commit is contained in:
Erik Jan de Wit 2023-06-29 13:11:59 +02:00 committed by GitHub
parent 8323e91f56
commit a6c85439c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 49 additions and 36 deletions

View file

@ -14,7 +14,7 @@ export default class AttributesTab {
}
public addAttribute(key: string, value: string) {
cy.findByTestId(this.addAttributeBtn).click();
this.addAnAttributeButton();
cy.findAllByTestId(this.keyInput)
.its("length")
@ -42,6 +42,7 @@ export default class AttributesTab {
}
public addAnAttributeButton() {
cy.wait(1000);
cy.findByTestId(this.addAttributeBtn).click();
return this;
}

View file

@ -82,8 +82,8 @@ export default class ProviderBaseGeneralSettingsPage extends PageObject {
return this;
}
protected assertCommonRequiredFields(requiredFiels: string[]) {
requiredFiels.forEach((elementLocator) => {
protected assertCommonRequiredFields(requiredFields: string[]) {
requiredFields.forEach((elementLocator) => {
if (elementLocator.includes("#")) {
cy.get(elementLocator)
.parent()

View file

@ -4,15 +4,19 @@ const additionalUsersProfile_input_test_value =
"additionalUsersProfile_input_test_value";
export default class ProviderFacebookGeneralSettings extends ProviderBaseGeneralSettingsPage {
private additionalUsersProfileFieldsInput = "#facebookFetchedFields";
private additionalUsersProfileFieldsInput = "fetchedFields";
public typeAdditionalUsersProfileFieldsInput(value: string) {
cy.get(this.additionalUsersProfileFieldsInput).type(value).blur();
cy.findByTestId(this.additionalUsersProfileFieldsInput).type(value);
cy.findByTestId(this.additionalUsersProfileFieldsInput).blur();
return this;
}
public assertAdditionalUsersProfileFieldsInputEqual(value: string) {
cy.get(this.additionalUsersProfileFieldsInput).should("have.value", value);
cy.findByTestId(this.additionalUsersProfileFieldsInput).should(
"have.value",
value
);
return this;
}

View file

@ -4,26 +4,28 @@ const base_url_input_test_value = "base_url_input_test_value";
const api_url_input_test_value = "api_url_input_test_value";
export default class ProviderGithubGeneralSettings extends ProviderBaseGeneralSettingsPage {
private baseUrlInput = "#baseUrl";
private apiUrlInput = "#apiUrl";
private baseUrlInput = "baseUrl";
private apiUrlInput = "apiUrl";
public typeBaseUrlInput(value: string) {
cy.get(this.baseUrlInput).type(value).blur();
cy.findByTestId(this.baseUrlInput).type(value);
cy.findByTestId(this.baseUrlInput).blur();
return this;
}
public typeApiUrlInput(value: string) {
cy.get(this.apiUrlInput).type(value).blur();
cy.findByTestId(this.apiUrlInput).type(value);
cy.findByTestId(this.apiUrlInput).blur();
return this;
}
public assertBaseUrlInputInputEqual(value: string) {
cy.get(this.baseUrlInput).should("have.value", value);
cy.findByTestId(this.baseUrlInput).should("have.value", value);
return this;
}
public assertApiUrlInputEqual(value: string) {
cy.get(this.apiUrlInput).should("have.value", value);
cy.findByTestId(this.apiUrlInput).should("have.value", value);
return this;
}

View file

@ -3,37 +3,41 @@ import ProviderBaseGeneralSettingsPage from "../ProviderBaseGeneralSettingsPage"
const hosted_domain_input_test_value = "hosted_domain_input_test_value";
export default class ProviderGoogleGeneralSettings extends ProviderBaseGeneralSettingsPage {
private hostedDomainInput = "#googleHostedDomain";
private useUserIpParamSwitch = "#googleUserIp";
private requestRefreshTokenSwitch = "#googleOfflineAccess";
private hostedDomainInput = "hostedDomain";
private useUserIpParamSwitch = "userIp";
private requestRefreshTokenSwitch = "offlineAccess";
public typeHostedDomainInput(value: string) {
cy.get(this.hostedDomainInput).type(value).blur();
cy.findByTestId(this.hostedDomainInput).type(value);
cy.findByTestId(this.hostedDomainInput).blur();
return this;
}
public clickUseUserIpParamSwitch() {
cy.get(this.useUserIpParamSwitch).parent().click();
cy.findByTestId(this.useUserIpParamSwitch).parent().click();
return this;
}
public clickRequestRefreshTokenSwitch() {
cy.get(this.requestRefreshTokenSwitch).parent().click();
cy.findByTestId(this.requestRefreshTokenSwitch).parent().click();
return this;
}
public assertHostedDomainInputEqual(value: string) {
cy.get(this.hostedDomainInput).should("have.value", value);
cy.findByTestId(this.hostedDomainInput).should("have.value", value);
return this;
}
public assertUseUserIpParamSwitchTurnedOn(isOn: boolean) {
super.assertSwitchStateOn(cy.get(this.useUserIpParamSwitch), isOn);
super.assertSwitchStateOn(cy.findByTestId(this.useUserIpParamSwitch), isOn);
return this;
}
public assertRequestRefreshTokenSwitchTurnedOn(isOn: boolean) {
super.assertSwitchStateOn(cy.get(this.requestRefreshTokenSwitch), isOn);
super.assertSwitchStateOn(
cy.findByTestId(this.requestRefreshTokenSwitch),
isOn
);
return this;
}
@ -48,8 +52,8 @@ export default class ProviderGoogleGeneralSettings extends ProviderBaseGeneralSe
public assertFilledDataEqual(idpName: string) {
this.assertCommonFilledDataEqual(idpName);
this.assertHostedDomainInputEqual(hosted_domain_input_test_value);
this.assertSwitchStateOn(cy.get(this.useUserIpParamSwitch));
this.assertSwitchStateOn(cy.get(this.requestRefreshTokenSwitch));
this.assertSwitchStateOn(cy.findByTestId(this.useUserIpParamSwitch));
this.assertSwitchStateOn(cy.findByTestId(this.requestRefreshTokenSwitch));
return this;
}
}

View file

@ -3,20 +3,20 @@ import ProviderBaseGeneralSettingsPage from "../ProviderBaseGeneralSettingsPage"
const base_url_input_test_value = "base_url_input_test_value";
export default class ProviderOpenshiftGeneralSettings extends ProviderBaseGeneralSettingsPage {
private baseUrlInput = "#baseUrl";
private baseUrlInput = "baseUrl";
constructor() {
super();
this.requiredFields.push(this.baseUrlInput);
}
public typeBaseUrlInput(value: string) {
cy.get(this.baseUrlInput).type(value).blur();
cy.findByTestId(this.baseUrlInput).type(value);
cy.findByTestId(this.baseUrlInput).blur();
return this;
}
public assertbaseUrlInputEqual(value: string) {
cy.get(this.baseUrlInput).should("have.value", value);
cy.findByTestId(this.baseUrlInput).should("have.value", value);
return this;
}
@ -26,7 +26,9 @@ export default class ProviderOpenshiftGeneralSettings extends ProviderBaseGenera
public fillData(idpName: string) {
this.fillCommonFields(idpName);
cy.get(this.baseUrlInput).type(idpName + base_url_input_test_value);
cy.findByTestId(this.baseUrlInput).type(
idpName + base_url_input_test_value
);
return this;
}

View file

@ -1,15 +1,15 @@
import ProviderBaseGeneralSettingsPage from "../ProviderBaseGeneralSettingsPage";
export default class ProviderPaypalGeneralSettings extends ProviderBaseGeneralSettingsPage {
private targetSandboxSwitch = "#paypalSandbox";
private targetSandboxSwitch = "sandbox";
public clickTargetSandboxSwitch() {
cy.get(this.targetSandboxSwitch).parent().click();
cy.findByTestId(this.targetSandboxSwitch).parent().click();
return this;
}
public assertTargetSandboxSwitchTurnedOn(isOn: boolean) {
super.assertSwitchStateOn(cy.get(this.targetSandboxSwitch), isOn);
super.assertSwitchStateOn(cy.findByTestId(this.targetSandboxSwitch), isOn);
return this;
}
@ -21,7 +21,7 @@ export default class ProviderPaypalGeneralSettings extends ProviderBaseGeneralSe
public assertFilledDataEqual(idpName: string) {
this.assertCommonFilledDataEqual(idpName);
this.assertSwitchStateOn(cy.get(this.targetSandboxSwitch));
this.assertSwitchStateOn(cy.findByTestId(this.targetSandboxSwitch));
return this;
}
}

View file

@ -3,20 +3,20 @@ import ProviderBaseGeneralSettingsPage from "../ProviderBaseGeneralSettingsPage"
const key_input_test_value = "key_input_test_value";
export default class ProviderStackoverflowGeneralSettings extends ProviderBaseGeneralSettingsPage {
private keyInput = "#stackoverflowKey";
private keyInput = "key";
constructor() {
super();
this.requiredFields.push(this.keyInput);
}
public typeKeyInput(value: string) {
cy.get(this.keyInput).type(value).blur();
cy.findByTestId(this.keyInput).type(value);
cy.findByTestId(this.keyInput).blur();
return this;
}
public assertKeyInputEqual(value: string) {
cy.get(this.keyInput).should("have.value", value);
cy.findByTestId(this.keyInput).should("have.value", value);
return this;
}