Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add oauth2 condition to commands file #54

Merged
merged 2 commits into from
Aug 17, 2020
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
2 changes: 1 addition & 1 deletion generators/client/templates/angular/package.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
"ts-node": "8.10.2",
<%_ } _%>
<%_ if (cypressTests) { _%>
"cypress": "4.12.1",
"cypress": "4.12.1",
<%_ } _%>
"tslint": "6.1.2",
"typescript": "3.9.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const passwordItemSelector = '[data-cy="passwordItem"]';
export const loginItemSelector = '[data-cy="login"]';
export const logoutItemSelector = '[data-cy="logout"]';

<%_ if (authenticationType !== 'oauth2') { _%>
// Login
export const titleLoginSelector = '[data-cy="loginTitle"]';
export const errorLoginSelector = '[data-cy="loginError"]';
Expand All @@ -43,13 +44,6 @@ export const firstPasswordRegisterSelector = '[data-cy="firstPassword"]';
export const secondPasswordRegisterSelector = '[data-cy="secondPassword"]';
export const submitRegisterSelector = '[data-cy="submit"]';

// Administration
export const userManagementPageHeadingSelector = '[data-cy="userManagementPageHeading"]';
export const metricsPageHeadingSelector = '[data-cy="metricsPageHeading"]';
export const healthPageHeadingSelector = '[data-cy="healthPageHeading"]';
export const logsPageHeadingSelector = '[data-cy="logsPageHeading"]';
export const configurationPageHeadingSelector = '[data-cy="configurationPageHeading"]';

// Settings
export const firstNameSettingsSelector = '[data-cy="firstname"]';
export const lastNameSettingsSelector = '[data-cy="lastname"]';
Expand All @@ -66,6 +60,14 @@ export const submitPasswordSelector = '[data-cy="submit"]';
// Reset Password
export const emailResetPasswordSelector = '[data-cy="emailResetPassword"]';
export const submitInitResetPasswordSelector = '[data-cy="submit"]';
<%_ } _%>

// Administration
export const userManagementPageHeadingSelector = '[data-cy="userManagementPageHeading"]';
export const metricsPageHeadingSelector = '[data-cy="metricsPageHeading"]';
export const healthPageHeadingSelector = '[data-cy="healthPageHeading"]';
export const logsPageHeadingSelector = '[data-cy="logsPageHeading"]';
export const configurationPageHeadingSelector = '[data-cy="configurationPageHeading"]';

// ***********************************************
// End Specific Selector Attributes for Cypress
Expand All @@ -79,7 +81,7 @@ export const classValid = <%_ if (clientFramework === 'angularX') { _%>'ng-valid
<%_ } else if (clientFramework === 'react') { _%>'av-valid';
<%_ } else { _%>'valid';<%_ } _%>


<%_ if (authenticationType !== 'oauth2') { _%>
Cypress.Commands.add('login', (username: string, password: string) => {
cy.clickOnLoginItem();
cy.get(usernameLoginSelector).type(username);
Expand All @@ -94,6 +96,7 @@ declare global {
}
}
}
<%_ } _%>

// Convert this to a module instead of script (allows import/export)
export {};