From f190ce588810435f81ec5f6f62e1e377b73c5c45 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Fri, 9 Aug 2024 19:53:46 -0300 Subject: [PATCH 1/3] fix cypress --- .../src/test/javascript/cypress/e2e/entity/_entity_.cy.ts.ejs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/generators/cypress/templates/src/test/javascript/cypress/e2e/entity/_entity_.cy.ts.ejs b/generators/cypress/templates/src/test/javascript/cypress/e2e/entity/_entity_.cy.ts.ejs index c1e7babd9760..94960c44f33e 100644 --- a/generators/cypress/templates/src/test/javascript/cypress/e2e/entity/_entity_.cy.ts.ejs +++ b/generators/cypress/templates/src/test/javascript/cypress/e2e/entity/_entity_.cy.ts.ejs @@ -52,7 +52,9 @@ describe('<%= entityClass %> e2e test', () => { const <%= entityInstance %>PageUrlPattern = new RegExp('/<%= entityPage %>(\\?.*)?$'); const username = Cypress.env('E2E_USERNAME') ?? '<%- adminEntity ? 'admin' : 'user' %>'; const password = Cypress.env('E2E_PASSWORD') ?? '<%- adminEntity ? 'admin' : 'user' %>'; +<%_ if (!readOnly) { _%> <% if (skipCreateTest) { %>// <% } %>const <%= entityInstance %>Sample = <%- JSON.stringify(this.generateTestEntity(sampleFields.map(field => field.reference))) %>; +<%_ } _%> let <%= entityInstance %>; <%_ for (otherEntity of requiredOtherEntities) { _%> @@ -179,7 +181,7 @@ describe('<%= entityClass %> e2e test', () => { <%_ } _%> describe('with existing value', () => { -<% if (!readOnly) { %> +<%_ if (!readOnly) { _%> <%_ if (skipCreateTest) { _%> /* Disabled due to incompatibility <%_ } _%> From dbf97094c3009ccbc62a71836385269ab0a22f32 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Fri, 9 Aug 2024 19:54:01 -0300 Subject: [PATCH 2/3] execute frontend test on cypress changes --- test-integration/scripts/99-build-changes.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/test-integration/scripts/99-build-changes.sh b/test-integration/scripts/99-build-changes.sh index 92343b061c06..0b355d6ee726 100755 --- a/test-integration/scripts/99-build-changes.sh +++ b/test-integration/scripts/99-build-changes.sh @@ -74,6 +74,7 @@ echo "::group::Check Client Common" git -c color.ui=always diff --exit-code @~1 -- \ 'generators/bootstrap-application-client' \ 'generators/client/**' \ + 'generators/cypress/**' \ 'generators/javascript/**' \ || CLIENT_COMMON=true echo "::endgroup::" From d4cefb498e92f064cbbd0a8b2e2eba6d9d977431 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Sat, 10 Aug 2024 07:07:06 -0300 Subject: [PATCH 3/3] Update oauth2.ts.ejs --- .../src/test/javascript/cypress/support/oauth2.ts.ejs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/generators/cypress/templates/src/test/javascript/cypress/support/oauth2.ts.ejs b/generators/cypress/templates/src/test/javascript/cypress/support/oauth2.ts.ejs index 19b00403f219..af1591fb00cd 100644 --- a/generators/cypress/templates/src/test/javascript/cypress/support/oauth2.ts.ejs +++ b/generators/cypress/templates/src/test/javascript/cypress/support/oauth2.ts.ejs @@ -17,8 +17,6 @@ limitations under the License. -%> /* eslint-disable @typescript-eslint/no-namespace */ -// eslint-disable-next-line spaced-comment -/// Cypress.Commands.add('getOauth2Data', () => { cy.request({ @@ -158,6 +156,7 @@ Cypress.Commands.add('oauthLogout', () => { declare global { namespace Cypress { + // eslint-disable-next-line @typescript-eslint/no-unused-vars interface Chainable { getOauth2Data(): Cypress.Chainable; oauthLogin(oauth2Data, username: string, password: string): Cypress.Chainable;