From 475fdc1aa600e6c221f660fe8f7b8ca31f030db3 Mon Sep 17 00:00:00 2001 From: tehkai Date: Wed, 21 Aug 2024 16:16:40 -0400 Subject: [PATCH 1/3] fix(entities): form state data-testids [khcp-13000] --- .../src/components/CACertificateForm.cy.ts | 92 +++---- .../src/components/CertificateForm.cy.ts | 148 +++++------ .../src/components/ConsumerGroupForm.cy.ts | 28 +-- .../src/components/ConsumerForm.cy.ts | 20 +- .../src/components/GatewayServiceForm.cy.ts | 60 ++--- .../src/components/KeySetForm.cy.ts | 88 +++---- .../src/components/KeyForm.cy.ts | 104 ++++---- .../src/components/PluginForm.cy.ts | 132 +++++----- .../src/components/PluginForm.vue | 7 +- .../src/components/RouteForm.cy.ts | 236 +++++++++--------- .../entity-base-form/EntityBaseForm.cy.ts | 28 +-- .../entity-base-form/EntityBaseForm.vue | 7 +- .../src/components/SniForm.cy.ts | 88 +++---- .../src/components/UpstreamsForm.cy.ts | 36 +-- .../src/components/SecretForm.cy.ts | 40 +-- .../src/components/VaultForm.cy.ts | 158 ++++++------ 16 files changed, 637 insertions(+), 635 deletions(-) diff --git a/packages/entities/entities-certificates/src/components/CACertificateForm.cy.ts b/packages/entities/entities-certificates/src/components/CACertificateForm.cy.ts index 8e537de07b..a070aa22c8 100644 --- a/packages/entities/entities-certificates/src/components/CACertificateForm.cy.ts +++ b/packages/entities/entities-certificates/src/components/CACertificateForm.cy.ts @@ -71,10 +71,10 @@ describe('', () => { cy.get('.kong-ui-entities-ca-certificates-form').should('be.visible') cy.get('.kong-ui-entities-ca-certificates-form form').should('be.visible') // button state - cy.getTestId('ca_certificate-form-cancel').should('be.visible') - cy.getTestId('ca_certificate-form-submit').should('be.visible') - cy.getTestId('ca_certificate-form-cancel').should('be.enabled') - cy.getTestId('ca_certificate-form-submit').should('be.disabled') + cy.getTestId('ca_certificate-create-form-cancel').should('be.visible') + cy.getTestId('ca_certificate-create-form-submit').should('be.visible') + cy.getTestId('ca_certificate-create-form-cancel').should('be.enabled') + cy.getTestId('ca_certificate-create-form-submit').should('be.disabled') // form fields cy.getTestId('ca-certificate-form-cert').should('be.visible') cy.getTestId('ca-certificate-form-cert-digest').should('be.visible') @@ -90,16 +90,16 @@ describe('', () => { cy.get('.kong-ui-entities-ca-certificates-form').should('be.visible') // default button state - cy.getTestId('ca_certificate-form-cancel').should('be.visible') - cy.getTestId('ca_certificate-form-submit').should('be.visible') - cy.getTestId('ca_certificate-form-cancel').should('be.enabled') - cy.getTestId('ca_certificate-form-submit').should('be.disabled') + cy.getTestId('ca_certificate-create-form-cancel').should('be.visible') + cy.getTestId('ca_certificate-create-form-submit').should('be.visible') + cy.getTestId('ca_certificate-create-form-cancel').should('be.enabled') + cy.getTestId('ca_certificate-create-form-submit').should('be.disabled') // enables save when required fields have values cy.getTestId('ca-certificate-form-cert').type(caCertificate1.cert) - cy.getTestId('ca_certificate-form-submit').should('be.enabled') + cy.getTestId('ca_certificate-create-form-submit').should('be.enabled') // disables save when required field is cleared cy.getTestId('ca-certificate-form-cert').clear() - cy.getTestId('ca_certificate-form-submit').should('be.disabled') + cy.getTestId('ca_certificate-create-form-submit').should('be.disabled') }) it('should show edit form', () => { @@ -115,10 +115,10 @@ describe('', () => { cy.wait('@getCertificate') cy.get('.kong-ui-entities-ca-certificates-form').should('be.visible') // button state - cy.getTestId('ca_certificate-form-cancel').should('be.visible') - cy.getTestId('ca_certificate-form-submit').should('be.visible') - cy.getTestId('ca_certificate-form-cancel').should('be.enabled') - cy.getTestId('ca_certificate-form-submit').should('be.disabled') + cy.getTestId('ca_certificate-edit-form-cancel').should('be.visible') + cy.getTestId('ca_certificate-edit-form-submit').should('be.visible') + cy.getTestId('ca_certificate-edit-form-cancel').should('be.enabled') + cy.getTestId('ca_certificate-edit-form-submit').should('be.disabled') // form fields cy.getTestId('ca-certificate-form-cert').should('have.value', caCertificate1.cert) }) @@ -136,16 +136,16 @@ describe('', () => { cy.wait('@getCertificate') cy.get('.kong-ui-entities-ca-certificates-form').should('be.visible') // default button state - cy.getTestId('ca_certificate-form-cancel').should('be.visible') - cy.getTestId('ca_certificate-form-submit').should('be.visible') - cy.getTestId('ca_certificate-form-cancel').should('be.enabled') - cy.getTestId('ca_certificate-form-submit').should('be.disabled') + cy.getTestId('ca_certificate-edit-form-cancel').should('be.visible') + cy.getTestId('ca_certificate-edit-form-submit').should('be.visible') + cy.getTestId('ca_certificate-edit-form-cancel').should('be.enabled') + cy.getTestId('ca_certificate-edit-form-submit').should('be.disabled') // enables save when form has changes cy.getTestId('ca-certificate-form-cert-digest').type('edited') - cy.getTestId('ca_certificate-form-submit').should('be.enabled') + cy.getTestId('ca_certificate-edit-form-submit').should('be.enabled') // disables save when form changes are undone cy.getTestId('ca-certificate-form-cert-digest').clear() - cy.getTestId('ca_certificate-form-submit').should('be.disabled') + cy.getTestId('ca_certificate-edit-form-submit').should('be.disabled') }) it('should handle error state - failed to load CA Certificate', () => { @@ -172,8 +172,8 @@ describe('', () => { // error state is displayed cy.getTestId('form-fetch-error').should('be.visible') // buttons and form hidden - cy.getTestId('ca_certificate-form-cancel').should('not.exist') - cy.getTestId('ca_certificate-form-submit').should('not.exist') + cy.getTestId('ca_certificate-edit-form-cancel').should('not.exist') + cy.getTestId('ca_certificate-edit-form-submit').should('not.exist') cy.get('.kong-ui-entities-ca-certificates-form form').should('not.exist') }) @@ -255,13 +255,13 @@ describe('', () => { cy.get('.kong-ui-entities-ca-certificates-form').should('be.visible') cy.get('.kong-ui-entities-ca-certificates-form form').should('be.visible') // button state - cy.getTestId('ca_certificate-form-cancel').should('be.visible') - cy.getTestId('ca_certificate-form-submit').should('be.visible') - cy.getTestId('ca_certificate-form-cancel').should('be.enabled') - cy.getTestId('ca_certificate-form-submit').should('be.disabled') + cy.getTestId('ca_certificate-create-form-cancel').should('be.visible') + cy.getTestId('ca_certificate-create-form-submit').should('be.visible') + cy.getTestId('ca_certificate-create-form-cancel').should('be.enabled') + cy.getTestId('ca_certificate-create-form-submit').should('be.disabled') // form fields - cy.getTestId('ca-certificate-form-cert').should('be.visible') - cy.getTestId('ca-certificate-form-cert-digest').should('be.visible') + cy.getTestId('ca-certificate-create-form-cert').should('be.visible') + cy.getTestId('ca-certificate-create-form-cert-digest').should('be.visible') cy.getTestId('ca-certificate-form-tags').should('be.visible') }) @@ -273,16 +273,16 @@ describe('', () => { }) cy.get('.kong-ui-entities-ca-certificates-form').should('be.visible') // default button state - cy.getTestId('ca_certificate-form-cancel').should('be.visible') - cy.getTestId('ca_certificate-form-submit').should('be.visible') - cy.getTestId('ca_certificate-form-cancel').should('be.enabled') - cy.getTestId('ca_certificate-form-submit').should('be.disabled') + cy.getTestId('ca_certificate-create-form-cancel').should('be.visible') + cy.getTestId('ca_certificate-create-form-submit').should('be.visible') + cy.getTestId('ca_certificate-create-form-cancel').should('be.enabled') + cy.getTestId('ca_certificate-create-form-submit').should('be.disabled') // enables save when required fields have values cy.getTestId('ca-certificate-form-cert').type(caCertificate1.cert) - cy.getTestId('ca_certificate-form-submit').should('be.enabled') + cy.getTestId('ca_certificate-create-form-submit').should('be.enabled') // disables save when required field is cleared cy.getTestId('ca-certificate-form-cert').clear() - cy.getTestId('ca_certificate-form-submit').should('be.disabled') + cy.getTestId('ca_certificate-create-form-submit').should('be.disabled') }) it('should show edit form', () => { @@ -298,10 +298,10 @@ describe('', () => { cy.wait('@getCertificate') cy.get('.kong-ui-entities-ca-certificates-form').should('be.visible') // button state - cy.getTestId('ca_certificate-form-cancel').should('be.visible') - cy.getTestId('ca_certificate-form-submit').should('be.visible') - cy.getTestId('ca_certificate-form-cancel').should('be.enabled') - cy.getTestId('ca_certificate-form-submit').should('be.disabled') + cy.getTestId('ca_certificate-edit-form-cancel').should('be.visible') + cy.getTestId('ca_certificate-edit-form-submit').should('be.visible') + cy.getTestId('ca_certificate-edit-form-cancel').should('be.enabled') + cy.getTestId('ca_certificate-edit-form-submit').should('be.disabled') // form fields cy.getTestId('ca-certificate-form-cert').should('have.value', caCertificate1.cert) }) @@ -319,16 +319,16 @@ describe('', () => { cy.wait('@getCertificate') cy.get('.kong-ui-entities-ca-certificates-form').should('be.visible') // default button state - cy.getTestId('ca_certificate-form-cancel').should('be.visible') - cy.getTestId('ca_certificate-form-submit').should('be.visible') - cy.getTestId('ca_certificate-form-cancel').should('be.enabled') - cy.getTestId('ca_certificate-form-submit').should('be.disabled') + cy.getTestId('ca_certificate-edit-form-cancel').should('be.visible') + cy.getTestId('ca_certificate-edit-form-submit').should('be.visible') + cy.getTestId('ca_certificate-edit-form-cancel').should('be.enabled') + cy.getTestId('ca_certificate-edit-form-submit').should('be.disabled') // enables save when form has changes cy.getTestId('ca-certificate-form-cert-digest').type('edited') - cy.getTestId('ca_certificate-form-submit').should('be.enabled') + cy.getTestId('ca_certificate-edit-form-submit').should('be.enabled') // disables save when form changes are undone cy.getTestId('ca-certificate-form-cert-digest').clear() - cy.getTestId('ca_certificate-form-submit').should('be.disabled') + cy.getTestId('ca_certificate-edit-form-submit').should('be.disabled') }) it('should handle error state - failed to load CA Certificate', () => { @@ -355,8 +355,8 @@ describe('', () => { // error state is displayed cy.getTestId('form-fetch-error').should('be.visible') // buttons and form hidden - cy.getTestId('ca_certificate-form-cancel').should('not.exist') - cy.getTestId('ca_certificate-form-submit').should('not.exist') + cy.getTestId('ca_certificate-create-form-cancel').should('not.exist') + cy.getTestId('ca_certificate-create-form-submit').should('not.exist') cy.get('.kong-ui-entities-ca-certificates-form form').should('not.exist') }) diff --git a/packages/entities/entities-certificates/src/components/CertificateForm.cy.ts b/packages/entities/entities-certificates/src/components/CertificateForm.cy.ts index f738308b00..f80939af4d 100644 --- a/packages/entities/entities-certificates/src/components/CertificateForm.cy.ts +++ b/packages/entities/entities-certificates/src/components/CertificateForm.cy.ts @@ -129,10 +129,10 @@ describe('', () => { cy.get('.kong-ui-entities-certificates-form').should('be.visible') cy.get('.kong-ui-entities-certificates-form form').should('be.visible') // button state - cy.getTestId('certificate-form-cancel').should('be.visible') - cy.getTestId('certificate-form-submit').should('be.visible') - cy.getTestId('certificate-form-cancel').should('be.enabled') - cy.getTestId('certificate-form-submit').should('be.disabled') + cy.getTestId('certificate-create-form-cancel').should('be.visible') + cy.getTestId('certificate-create-form-submit').should('be.visible') + cy.getTestId('certificate-create-form-cancel').should('be.enabled') + cy.getTestId('certificate-create-form-submit').should('be.disabled') // form fields cy.getTestId('certificate-form-cert').should('be.visible') cy.getTestId('certificate-form-key').should('be.visible') @@ -151,17 +151,17 @@ describe('', () => { cy.get('.kong-ui-entities-certificates-form').should('be.visible') // default button state - cy.getTestId('certificate-form-cancel').should('be.visible') - cy.getTestId('certificate-form-submit').should('be.visible') - cy.getTestId('certificate-form-cancel').should('be.enabled') - cy.getTestId('certificate-form-submit').should('be.disabled') + cy.getTestId('certificate-create-form-cancel').should('be.visible') + cy.getTestId('certificate-create-form-submit').should('be.visible') + cy.getTestId('certificate-create-form-cancel').should('be.enabled') + cy.getTestId('certificate-create-form-submit').should('be.disabled') // enables save when required fields have values cy.getTestId('certificate-form-cert').type(certificate1.cert, { delay: 0 }) cy.getTestId('certificate-form-key').type(certificate1.key, { delay: 0 }) - cy.getTestId('certificate-form-submit').should('be.enabled') + cy.getTestId('certificate-create-form-submit').should('be.enabled') // disables save when required field is cleared cy.getTestId('certificate-form-cert').clear() - cy.getTestId('certificate-form-submit').should('be.disabled') + cy.getTestId('certificate-create-form-submit').should('be.disabled') }) it('should show edit form', () => { @@ -177,10 +177,10 @@ describe('', () => { cy.wait('@getCertificate') cy.get('.kong-ui-entities-certificates-form').should('be.visible') // button state - cy.getTestId('certificate-form-cancel').should('be.visible') - cy.getTestId('certificate-form-submit').should('be.visible') - cy.getTestId('certificate-form-cancel').should('be.enabled') - cy.getTestId('certificate-form-submit').should('be.disabled') + cy.getTestId('certificate-edit-form-cancel').should('be.visible') + cy.getTestId('certificate-edit-form-submit').should('be.visible') + cy.getTestId('certificate-edit-form-cancel').should('be.enabled') + cy.getTestId('certificate-edit-form-submit').should('be.disabled') // form fields cy.getTestId('certificate-form-cert').should('have.value', certificate1.cert) cy.getTestId('certificate-form-key').should('have.value', certificate1.key) @@ -199,16 +199,16 @@ describe('', () => { cy.wait('@getCertificate') cy.get('.kong-ui-entities-certificates-form').should('be.visible') // default button state - cy.getTestId('certificate-form-cancel').should('be.visible') - cy.getTestId('certificate-form-submit').should('be.visible') - cy.getTestId('certificate-form-cancel').should('be.enabled') - cy.getTestId('certificate-form-submit').should('be.disabled') + cy.getTestId('certificate-edit-form-cancel').should('be.visible') + cy.getTestId('certificate-edit-form-submit').should('be.visible') + cy.getTestId('certificate-edit-form-cancel').should('be.enabled') + cy.getTestId('certificate-edit-form-submit').should('be.disabled') // enables save when form has changes cy.getTestId('certificate-form-cert-alt').type('edited') - cy.getTestId('certificate-form-submit').should('be.enabled') + cy.getTestId('certificate-edit-form-submit').should('be.enabled') // disables save when form changes are undone cy.getTestId('certificate-form-cert-alt').clear() - cy.getTestId('certificate-form-submit').should('be.disabled') + cy.getTestId('certificate-edit-form-submit').should('be.disabled') }) it('should handle error state - failed to load Certificate', () => { @@ -235,8 +235,8 @@ describe('', () => { // error state is displayed cy.getTestId('form-fetch-error').should('be.visible') // buttons and form hidden - cy.getTestId('certificate-form-cancel').should('not.exist') - cy.getTestId('certificate-form-submit').should('not.exist') + cy.getTestId('certificate-edit-form-cancel').should('not.exist') + cy.getTestId('certificate-create-form-submit').should('not.exist') cy.get('.kong-ui-entities-certificates-form form').should('not.exist') }) @@ -279,10 +279,10 @@ describe('', () => { cy.get('.kong-ui-entities-certificates-form').should('be.visible') // default button state - cy.getTestId('certificate-form-cancel').should('be.visible') - cy.getTestId('certificate-form-submit').should('be.visible') - cy.getTestId('certificate-form-cancel').should('be.enabled') - cy.getTestId('certificate-form-submit').should('be.disabled') + cy.getTestId('certificate-create-form-cancel').should('be.visible') + cy.getTestId('certificate-create-form-submit').should('be.visible') + cy.getTestId('certificate-create-form-cancel').should('be.enabled') + cy.getTestId('certificate-create-form-submit').should('be.disabled') // enables save when required fields have values cy.getTestId('certificate-form-cert').type(certificate1.cert, { delay: 0 }) cy.getTestId('certificate-form-key').type(certificate1.key, { delay: 0 }) @@ -291,7 +291,7 @@ describe('', () => { cy.getTestId('certificate-form-cert-alt').type(secp384r1CertKeyPair.cert.replaceAll('\n', ' '), { delay: 0 }) cy.getTestId('certificate-form-key-alt').type(secp384r1CertKeyPair.key.replaceAll('\n', ' '), { delay: 0 }) - cy.getTestId('certificate-form-submit').should('be.enabled') + cy.getTestId('certificate-create-form-submit').should('be.enabled') cy.get('@vueWrapper').then(wrapper => wrapper.findComponent(EntityBaseForm) .vm.$emit('submit')) @@ -312,10 +312,10 @@ describe('', () => { cy.get('.kong-ui-entities-certificates-form').should('be.visible') // default button state - cy.getTestId('certificate-form-cancel').should('be.visible') - cy.getTestId('certificate-form-submit').should('be.visible') - cy.getTestId('certificate-form-cancel').should('be.enabled') - cy.getTestId('certificate-form-submit').should('be.disabled') + cy.getTestId('certificate-create-form-cancel').should('be.visible') + cy.getTestId('certificate-create-form-submit').should('be.visible') + cy.getTestId('certificate-create-form-cancel').should('be.enabled') + cy.getTestId('certificate-create-form-submit').should('be.disabled') // enables save when required fields have values cy.getTestId('certificate-form-cert').type(certificate1.cert, { delay: 0 }) cy.getTestId('certificate-form-key').type(certificate1.key, { delay: 0 }) @@ -324,7 +324,7 @@ describe('', () => { cy.getTestId('certificate-form-cert-alt').type(secp384r1CertKeyPair.cert, { delay: 0 }) cy.getTestId('certificate-form-key-alt').type(secp384r1CertKeyPair.key, { delay: 0 }) - cy.getTestId('certificate-form-submit').should('be.enabled') + cy.getTestId('certificate-create-form-submit').should('be.enabled') cy.get('@vueWrapper').then((wrapper: any) => wrapper.findComponent(EntityBaseForm) .vm.$emit('submit')) @@ -347,15 +347,15 @@ describe('', () => { cy.get('.kong-ui-entities-certificates-form').should('be.visible') // default button state - cy.getTestId('certificate-form-cancel').should('be.visible') - cy.getTestId('certificate-form-submit').should('be.visible') - cy.getTestId('certificate-form-cancel').should('be.enabled') - cy.getTestId('certificate-form-submit').should('be.disabled') + cy.getTestId('certificate-create-form-cancel').should('be.visible') + cy.getTestId('certificate-create-form-submit').should('be.visible') + cy.getTestId('certificate-create-form-cancel').should('be.enabled') + cy.getTestId('certificate-create-form-submit').should('be.disabled') cy.getTestId('certificate-form-cert').type(certificate1.cert, { delay: 0 }) cy.getTestId('certificate-form-key').type(certificate1.key, { delay: 0 }) cy.getTestId('sni-field-input-1').type('foo') - cy.getTestId('certificate-form-submit').should('be.enabled') + cy.getTestId('certificate-create-form-submit').should('be.enabled') cy.get('@vueWrapper').then(wrapper => wrapper.findComponent(EntityBaseForm) .vm.$emit('submit')) @@ -434,10 +434,10 @@ describe('', () => { cy.get('.kong-ui-entities-certificates-form').should('be.visible') cy.get('.kong-ui-entities-certificates-form form').should('be.visible') // button state - cy.getTestId('certificate-form-cancel').should('be.visible') - cy.getTestId('certificate-form-submit').should('be.visible') - cy.getTestId('certificate-form-cancel').should('be.enabled') - cy.getTestId('certificate-form-submit').should('be.disabled') + cy.getTestId('certificate-create-form-cancel').should('be.visible') + cy.getTestId('certificate-create-form-submit').should('be.visible') + cy.getTestId('certificate-create-form-cancel').should('be.enabled') + cy.getTestId('certificate-create-form-submit').should('be.disabled') // form fields cy.getTestId('certificate-form-cert').should('be.visible') cy.getTestId('certificate-form-key').should('be.visible') @@ -455,17 +455,17 @@ describe('', () => { }) cy.get('.kong-ui-entities-certificates-form').should('be.visible') // default button state - cy.getTestId('certificate-form-cancel').should('be.visible') - cy.getTestId('certificate-form-submit').should('be.visible') - cy.getTestId('certificate-form-cancel').should('be.enabled') - cy.getTestId('certificate-form-submit').should('be.disabled') + cy.getTestId('certificate-create-form-cancel').should('be.visible') + cy.getTestId('certificate-create-form-submit').should('be.visible') + cy.getTestId('certificate-create-form-cancel').should('be.enabled') + cy.getTestId('certificate-create-form-submit').should('be.disabled') // enables save when required fields have values cy.getTestId('certificate-form-cert').type(certificate1.cert, { delay: 0 }) cy.getTestId('certificate-form-key').type(certificate1.key, { delay: 0 }) - cy.getTestId('certificate-form-submit').should('be.enabled') + cy.getTestId('certificate-create-form-submit').should('be.enabled') // disables save when required field is cleared cy.getTestId('certificate-form-cert').clear() - cy.getTestId('certificate-form-submit').should('be.disabled') + cy.getTestId('certificate-create-form-submit').should('be.disabled') }) it('should show edit form', () => { @@ -481,10 +481,10 @@ describe('', () => { cy.wait('@getCertificate') cy.get('.kong-ui-entities-certificates-form').should('be.visible') // button state - cy.getTestId('certificate-form-cancel').should('be.visible') - cy.getTestId('certificate-form-submit').should('be.visible') - cy.getTestId('certificate-form-cancel').should('be.enabled') - cy.getTestId('certificate-form-submit').should('be.disabled') + cy.getTestId('certificate-edit-form-submit').should('be.visible') + cy.getTestId('certificate-edit-form-submit').should('be.visible') + cy.getTestId('certificate-edit-form-submit').should('be.enabled') + cy.getTestId('certificate-edit-form-submit').should('be.disabled') // form fields cy.getTestId('certificate-form-cert').should('have.value', certificate1.cert) cy.getTestId('certificate-form-key').should('have.value', certificate1.key) @@ -503,16 +503,16 @@ describe('', () => { cy.wait('@getCertificate') cy.get('.kong-ui-entities-certificates-form').should('be.visible') // default button state - cy.getTestId('certificate-form-cancel').should('be.visible') - cy.getTestId('certificate-form-submit').should('be.visible') - cy.getTestId('certificate-form-cancel').should('be.enabled') - cy.getTestId('certificate-form-submit').should('be.disabled') + cy.getTestId('certificate-edit-form-submit').should('be.visible') + cy.getTestId('certificate-edit-form-submit').should('be.visible') + cy.getTestId('certificate-edit-form-submit').should('be.enabled') + cy.getTestId('certificate-edit-form-submit').should('be.disabled') // enables save when form has changes cy.getTestId('certificate-form-cert-alt').type('edited') - cy.getTestId('certificate-form-submit').should('be.enabled') + cy.getTestId('certificate-edit-form-submit').should('be.enabled') // disables save when form changes are undone cy.getTestId('certificate-form-cert-alt').clear() - cy.getTestId('certificate-form-submit').should('be.disabled') + cy.getTestId('certificate-edit-form-submit').should('be.disabled') }) it('should handle error state - failed to load Certificate', () => { @@ -539,8 +539,8 @@ describe('', () => { // error state is displayed cy.getTestId('form-fetch-error').should('be.visible') // buttons and form hidden - cy.getTestId('certificate-form-cancel').should('not.exist') - cy.getTestId('certificate-form-submit').should('not.exist') + cy.getTestId('certificate-edit-form-submit').should('not.exist') + cy.getTestId('certificate-edit-form-submit').should('not.exist') cy.get('.kong-ui-entities-certificates-form form').should('not.exist') }) @@ -583,10 +583,10 @@ describe('', () => { cy.get('.kong-ui-entities-certificates-form').should('be.visible') // default button state - cy.getTestId('certificate-form-cancel').should('be.visible') - cy.getTestId('certificate-form-submit').should('be.visible') - cy.getTestId('certificate-form-cancel').should('be.enabled') - cy.getTestId('certificate-form-submit').should('be.disabled') + cy.getTestId('certificate-create-form-cancel').should('be.visible') + cy.getTestId('certificate-create-form-submit').should('be.visible') + cy.getTestId('certificate-create-form-cancel').should('be.enabled') + cy.getTestId('certificate-create-form-submit').should('be.disabled') // enables save when required fields have values cy.getTestId('certificate-form-cert').type(certificate1.cert, { delay: 0 }) cy.getTestId('certificate-form-key').type(certificate1.key, { delay: 0 }) @@ -595,7 +595,7 @@ describe('', () => { cy.getTestId('certificate-form-cert-alt').type(secp384r1CertKeyPair.cert.replaceAll('\n', ' '), { delay: 0 }) cy.getTestId('certificate-form-key-alt').type(secp384r1CertKeyPair.key.replaceAll('\n', ' '), { delay: 0 }) - cy.getTestId('certificate-form-submit').should('be.enabled') + cy.getTestId('certificate-create-form-submit').should('be.enabled') cy.get('@vueWrapper').then(wrapper => wrapper.findComponent(EntityBaseForm) .vm.$emit('submit')) @@ -616,10 +616,10 @@ describe('', () => { cy.get('.kong-ui-entities-certificates-form').should('be.visible') // default button state - cy.getTestId('certificate-form-cancel').should('be.visible') - cy.getTestId('certificate-form-submit').should('be.visible') - cy.getTestId('certificate-form-cancel').should('be.enabled') - cy.getTestId('certificate-form-submit').should('be.disabled') + cy.getTestId('certificate-create-form-cancel').should('be.visible') + cy.getTestId('certificate-create-form-submit').should('be.visible') + cy.getTestId('certificate-create-form-cancel').should('be.enabled') + cy.getTestId('certificate-create-form-submit').should('be.disabled') // enables save when required fields have values cy.getTestId('certificate-form-cert').type(certificate1.cert, { delay: 0 }) cy.getTestId('certificate-form-key').type(certificate1.key, { delay: 0 }) @@ -628,7 +628,7 @@ describe('', () => { cy.getTestId('certificate-form-cert-alt').type(secp384r1CertKeyPair.cert, { delay: 0 }) cy.getTestId('certificate-form-key-alt').type(secp384r1CertKeyPair.key, { delay: 0 }) - cy.getTestId('certificate-form-submit').should('be.enabled') + cy.getTestId('certificate-create-form-submit').should('be.enabled') cy.get('@vueWrapper').then((wrapper: any) => wrapper.findComponent(EntityBaseForm) .vm.$emit('submit')) @@ -651,15 +651,15 @@ describe('', () => { cy.get('.kong-ui-entities-certificates-form').should('be.visible') // default button state - cy.getTestId('certificate-form-cancel').should('be.visible') - cy.getTestId('certificate-form-submit').should('be.visible') - cy.getTestId('certificate-form-cancel').should('be.enabled') - cy.getTestId('certificate-form-submit').should('be.disabled') + cy.getTestId('certificate-create-form-cancel').should('be.visible') + cy.getTestId('certificate-create-form-submit').should('be.visible') + cy.getTestId('certificate-create-form-cancel').should('be.enabled') + cy.getTestId('certificate-create-form-submit').should('be.disabled') cy.getTestId('certificate-form-cert').type(certificate1.cert, { delay: 0 }) cy.getTestId('certificate-form-key').type(certificate1.key, { delay: 0 }) cy.getTestId('sni-field-input-1').type('foo') - cy.getTestId('certificate-form-submit').should('be.enabled') + cy.getTestId('certificate-create-form-submit').should('be.enabled') cy.get('@vueWrapper').then(wrapper => wrapper.findComponent(EntityBaseForm) .vm.$emit('submit')) diff --git a/packages/entities/entities-consumer-groups/src/components/ConsumerGroupForm.cy.ts b/packages/entities/entities-consumer-groups/src/components/ConsumerGroupForm.cy.ts index 82855e3ef9..bf995186fc 100644 --- a/packages/entities/entities-consumer-groups/src/components/ConsumerGroupForm.cy.ts +++ b/packages/entities/entities-consumer-groups/src/components/ConsumerGroupForm.cy.ts @@ -134,10 +134,10 @@ describe('', () => { cy.get('.multiselect-popover').should('be.visible') cy.get('.multiselect-popover .multiselect-item').should('have.length', 5) - cy.getTestId('consumer_group-form-cancel').should('be.visible') - cy.getTestId('consumer_group-form-cancel').should('be.enabled') - cy.getTestId('consumer_group-form-submit').should('be.visible') - cy.getTestId('consumer_group-form-submit').should('be.disabled') + cy.getTestId('consumer_group-create-form-cancel').should('be.visible') + cy.getTestId('consumer_group-create-form-cancel').should('be.enabled') + cy.getTestId('consumer_group-create-form-submit').should('be.visible') + cy.getTestId('consumer_group-create-form-submit').should('be.disabled') }) it('Submit button should be enabled if name field is filled in correctly', () => { @@ -151,12 +151,12 @@ describe('', () => { cy.wait('@fetchList') - cy.getTestId('consumer_group-form-submit').should('be.visible') - cy.getTestId('consumer_group-form-submit').should('be.disabled') + cy.getTestId('consumer_group-create-form-submit').should('be.visible') + cy.getTestId('consumer_group-create-form-submit').should('be.disabled') cy.getTestId('consumer-group-form-name').type('test_name') - cy.getTestId('consumer_group-form-submit').should('be.enabled') + cy.getTestId('consumer_group-create-form-submit').should('be.enabled') }) it('loading event should be emitted when EntityBaseForm emits loading event', () => { @@ -546,10 +546,10 @@ describe('', () => { cy.get('.multiselect-popover').should('be.visible') cy.get('.multiselect-popover .multiselect-item').should('have.length', 5) - cy.getTestId('consumer_group-form-cancel').should('be.visible') - cy.getTestId('consumer_group-form-cancel').should('be.enabled') - cy.getTestId('consumer_group-form-submit').should('be.visible') - cy.getTestId('consumer_group-form-submit').should('be.disabled') + cy.getTestId('consumer_group-create-form-cancel').should('be.visible') + cy.getTestId('consumer_group-create-form-cancel').should('be.enabled') + cy.getTestId('consumer_group-create-form-submit').should('be.visible') + cy.getTestId('consumer_group-create-form-submit').should('be.disabled') }) it('Submit button should be enabled if name field is filled in correctly', () => { @@ -563,12 +563,12 @@ describe('', () => { cy.wait('@fetchList') - cy.getTestId('consumer_group-form-submit').should('be.visible') - cy.getTestId('consumer_group-form-submit').should('be.disabled') + cy.getTestId('consumer_group-create-form-submit').should('be.visible') + cy.getTestId('consumer_group-create-form-submit').should('be.disabled') cy.getTestId('consumer-group-form-name').type('test_name') - cy.getTestId('consumer_group-form-submit').should('be.enabled') + cy.getTestId('consumer_group-create-form-submit').should('be.enabled') }) it('loading event should be emitted when EntityBaseForm emits loading event', () => { diff --git a/packages/entities/entities-consumers/src/components/ConsumerForm.cy.ts b/packages/entities/entities-consumers/src/components/ConsumerForm.cy.ts index 073ff3fb54..e038d8cf7c 100644 --- a/packages/entities/entities-consumers/src/components/ConsumerForm.cy.ts +++ b/packages/entities/entities-consumers/src/components/ConsumerForm.cy.ts @@ -39,10 +39,10 @@ describe('', () => { cy.getTestId('consumer-form-custom-id').should('be.visible') cy.getTestId('consumer-form-tags').should('be.visible') - cy.getTestId('consumer-form-cancel').should('be.visible') - cy.getTestId('consumer-form-cancel').should('be.enabled') - cy.getTestId('consumer-form-submit').should('be.visible') - cy.getTestId('consumer-form-submit').should('be.disabled') + cy.getTestId('consumer-create-form-cancel').should('be.visible') + cy.getTestId('consumer-create-form-cancel').should('be.enabled') + cy.getTestId('consumer-create-form-submit').should('be.visible') + cy.getTestId('consumer-create-form-submit').should('be.disabled') }) it('Submit button should be enabled if only username field is filled in', () => { @@ -52,12 +52,12 @@ describe('', () => { }, }) - cy.getTestId('consumer-form-submit').should('be.visible') - cy.getTestId('consumer-form-submit').should('be.disabled') + cy.getTestId('consumer-create-form-submit').should('be.visible') + cy.getTestId('consumer-create-form-submit').should('be.disabled') cy.getTestId('consumer-form-username').type('Test name') - cy.getTestId('consumer-form-submit').should('be.enabled') + cy.getTestId('consumer-create-form-submit').should('be.enabled') }) it('Submit button should be enabled if only customId field is filled in', () => { @@ -67,12 +67,12 @@ describe('', () => { }, }) - cy.getTestId('consumer-form-submit').should('be.visible') - cy.getTestId('consumer-form-submit').should('be.disabled') + cy.getTestId('consumer-create-form-submit').should('be.visible') + cy.getTestId('consumer-create-form-submit').should('be.disabled') cy.getTestId('consumer-form-custom-id').type('test_id') - cy.getTestId('consumer-form-submit').should('be.enabled') + cy.getTestId('consumer-create-form-submit').should('be.enabled') }) it('loading event should be emitted when EntityBaseForm emits loading event', () => { diff --git a/packages/entities/entities-gateway-services/src/components/GatewayServiceForm.cy.ts b/packages/entities/entities-gateway-services/src/components/GatewayServiceForm.cy.ts index 403457adc7..911e28c700 100644 --- a/packages/entities/entities-gateway-services/src/components/GatewayServiceForm.cy.ts +++ b/packages/entities/entities-gateway-services/src/components/GatewayServiceForm.cy.ts @@ -77,10 +77,10 @@ describe('', { viewportHeight: 800, viewportWidth: 700 }, cy.getTestId('gateway-service-url-input').should('be.visible') cy.getTestId('collapse-trigger-content').should('be.visible') - cy.getTestId('service-form-cancel').should('be.visible') - cy.getTestId('service-form-cancel').should('be.enabled') - cy.getTestId('service-form-submit').should('be.visible') - cy.getTestId('service-form-submit').should('be.disabled') + cy.getTestId('service-create-form-cancel').should('be.visible') + cy.getTestId('service-create-form-cancel').should('be.enabled') + cy.getTestId('service-create-form-submit').should('be.visible') + cy.getTestId('service-create-form-submit').should('be.disabled') }) it("should check for name's validity", () => { @@ -119,12 +119,12 @@ describe('', { viewportHeight: 800, viewportWidth: 700 }, }, }) - cy.getTestId('service-form-submit').should('be.visible') - cy.getTestId('service-form-submit').should('be.disabled') + cy.getTestId('service-create-form-submit').should('be.visible') + cy.getTestId('service-create-form-submit').should('be.disabled') cy.getTestId('gateway-service-url-input').type(gatewayService1.url) - cy.getTestId('service-form-submit').should('be.enabled') + cy.getTestId('service-create-form-submit').should('be.enabled') }) it('should handle error state - Upstream URL field validation fails', () => { @@ -136,7 +136,7 @@ describe('', { viewportHeight: 800, viewportWidth: 700 }, cy.get('.kong-ui-entities-gateway-service-form').should('be.visible') cy.getTestId('gateway-service-url-input').type('abcd') - cy.getTestId('service-form-submit').should('be.enabled').click() + cy.getTestId('service-create-form-submit').should('be.enabled').click() cy.getTestId('form-error').should('be.visible') }) @@ -148,12 +148,12 @@ describe('', { viewportHeight: 800, viewportWidth: 700 }, }) cy.getTestId('gateway-service-protocol-radio').click() - cy.getTestId('service-form-submit').should('be.visible') - cy.getTestId('service-form-submit').should('be.disabled') + cy.getTestId('service-create-form-submit').should('be.visible') + cy.getTestId('service-create-form-submit').should('be.disabled') cy.getTestId('gateway-service-host-input').type('google') - cy.getTestId('service-form-submit').should('be.enabled') + cy.getTestId('service-create-form-submit').should('be.enabled') }) it('should update correct Port value based on selected Protocol', () => { @@ -294,8 +294,8 @@ describe('', { viewportHeight: 800, viewportWidth: 700 }, // error state is displayed cy.getTestId('form-fetch-error').should('be.visible') // buttons and form hidden - cy.getTestId('service-form-cancel').should('not.exist') - cy.getTestId('service-form-submit').should('not.exist') + cy.getTestId('service-edit-form-cancel').should('not.exist') + cy.getTestId('service-edit-form-submit').should('not.exist') cy.get('.kong-ui-entities-gateway-service-form form').should('not.exist') }) @@ -313,8 +313,8 @@ describe('', { viewportHeight: 800, viewportWidth: 700 }, cy.wait('@getGatewayService') cy.get('.kong-ui-entities-gateway-service-form').should('be.visible') // button state - cy.getTestId('service-form-cancel').should('be.visible') - cy.getTestId('service-form-submit').should('be.visible') + cy.getTestId('service-edit-form-cancel').should('be.visible') + cy.getTestId('service-edit-form-submit').should('be.visible') // form fields cy.getTestId('gateway-service-name-input').should('have.value', gatewayService1.name) @@ -459,10 +459,10 @@ describe('', { viewportHeight: 800, viewportWidth: 700 }, cy.getTestId('gateway-service-url-input').should('be.visible') cy.getTestId('collapse-trigger-content').should('be.visible') - cy.getTestId('service-form-cancel').should('be.visible') - cy.getTestId('service-form-cancel').should('be.enabled') - cy.getTestId('service-form-submit').should('be.visible') - cy.getTestId('service-form-submit').should('be.disabled') + cy.getTestId('service-create-form-cancel').should('be.visible') + cy.getTestId('service-create-form-cancel').should('be.enabled') + cy.getTestId('service-create-form-submit').should('be.visible') + cy.getTestId('service-create-form-submit').should('be.disabled') }) it("should check for name's validity", () => { @@ -501,12 +501,12 @@ describe('', { viewportHeight: 800, viewportWidth: 700 }, }, }) - cy.getTestId('service-form-submit').should('be.visible') - cy.getTestId('service-form-submit').should('be.disabled') + cy.getTestId('service-create-form-submit').should('be.visible') + cy.getTestId('service-create-form-submit').should('be.disabled') cy.getTestId('gateway-service-url-input').type(gatewayService1.url) - cy.getTestId('service-form-submit').should('be.enabled') + cy.getTestId('service-create-form-submit').should('be.enabled') }) it('should handle error state - Upstream URL field validation fails', () => { @@ -518,7 +518,7 @@ describe('', { viewportHeight: 800, viewportWidth: 700 }, cy.get('.kong-ui-entities-gateway-service-form').should('be.visible') cy.getTestId('gateway-service-url-input').type('abcd') - cy.getTestId('service-form-submit').should('be.enabled').click() + cy.getTestId('service-create-form-submit').should('be.enabled').click() cy.getTestId('form-error').should('be.visible') }) @@ -530,12 +530,12 @@ describe('', { viewportHeight: 800, viewportWidth: 700 }, }) cy.getTestId('gateway-service-protocol-radio').click() - cy.getTestId('service-form-submit').should('be.visible') - cy.getTestId('service-form-submit').should('be.disabled') + cy.getTestId('service-create-form-submit').should('be.visible') + cy.getTestId('service-create-form-submit').should('be.disabled') cy.getTestId('gateway-service-host-input').type('google') - cy.getTestId('service-form-submit').should('be.enabled') + cy.getTestId('service-create-form-submit').should('be.enabled') }) it('should update correct Port value based on selected Protocol', () => { @@ -676,8 +676,8 @@ describe('', { viewportHeight: 800, viewportWidth: 700 }, // error state is displayed cy.getTestId('form-fetch-error').should('be.visible') // buttons and form hidden - cy.getTestId('service-form-cancel').should('not.exist') - cy.getTestId('service-form-submit').should('not.exist') + cy.getTestId('service-edit-form-cancel').should('not.exist') + cy.getTestId('service-edit-form-submit').should('not.exist') cy.get('.kong-ui-entities-gateway-service-form form').should('not.exist') }) @@ -695,8 +695,8 @@ describe('', { viewportHeight: 800, viewportWidth: 700 }, cy.wait('@getGatewayService') cy.get('.kong-ui-entities-gateway-service-form').should('be.visible') // button state - cy.getTestId('service-form-cancel').should('be.visible') - cy.getTestId('service-form-submit').should('be.visible') + cy.getTestId('service-edit-form-cancel').should('be.visible') + cy.getTestId('service-edit-form-submit').should('be.visible') // form fields cy.getTestId('gateway-service-name-input').should('have.value', gatewayService1.name) diff --git a/packages/entities/entities-key-sets/src/components/KeySetForm.cy.ts b/packages/entities/entities-key-sets/src/components/KeySetForm.cy.ts index 0ffbc81360..bab04f225d 100644 --- a/packages/entities/entities-key-sets/src/components/KeySetForm.cy.ts +++ b/packages/entities/entities-key-sets/src/components/KeySetForm.cy.ts @@ -61,10 +61,10 @@ describe('', () => { cy.get('.kong-ui-entities-key-sets-form').should('be.visible') cy.get('.kong-ui-entities-key-sets-form form').should('be.visible') // button state - cy.getTestId('set-form-cancel').should('be.visible') - cy.getTestId('set-form-submit').should('be.visible') - cy.getTestId('set-form-cancel').should('be.enabled') - cy.getTestId('set-form-submit').should('be.disabled') + cy.getTestId('set-create-form-cancel').should('be.visible') + cy.getTestId('set-create-form-submit').should('be.visible') + cy.getTestId('set-create-form-cancel').should('be.enabled') + cy.getTestId('set-create-form-submit').should('be.disabled') // form fields cy.getTestId('key-set-form-name').should('be.visible') cy.getTestId('key-set-form-tags').should('be.visible') @@ -79,16 +79,16 @@ describe('', () => { cy.get('.kong-ui-entities-key-sets-form').should('be.visible') // default button state - cy.getTestId('set-form-cancel').should('be.visible') - cy.getTestId('set-form-submit').should('be.visible') - cy.getTestId('set-form-cancel').should('be.enabled') - cy.getTestId('set-form-submit').should('be.disabled') + cy.getTestId('set-create-form-cancel').should('be.visible') + cy.getTestId('set-create-form-submit').should('be.visible') + cy.getTestId('set-create-form-cancel').should('be.enabled') + cy.getTestId('set-create-form-submit').should('be.disabled') // enables save when required fields have values cy.getTestId('key-set-form-name').type('my-key-set') - cy.getTestId('set-form-submit').should('be.enabled') + cy.getTestId('set-create-form-submit').should('be.enabled') // disables save when required field is cleared cy.getTestId('key-set-form-name').clear() - cy.getTestId('set-form-submit').should('be.disabled') + cy.getTestId('set-create-form-submit').should('be.disabled') }) it('should show edit form', () => { @@ -104,10 +104,10 @@ describe('', () => { cy.wait('@getKeySet') cy.get('.kong-ui-entities-key-sets-form').should('be.visible') // button state - cy.getTestId('set-form-cancel').should('be.visible') - cy.getTestId('set-form-submit').should('be.visible') - cy.getTestId('set-form-cancel').should('be.enabled') - cy.getTestId('set-form-submit').should('be.disabled') + cy.getTestId('set-edit-form-cancel').should('be.visible') + cy.getTestId('set-edit-form-submit').should('be.visible') + cy.getTestId('set-edit-form-cancel').should('be.enabled') + cy.getTestId('set-edit-form-submit').should('be.disabled') // form fields cy.getTestId('key-set-form-name').should('have.value', keySet1.name) keySet1.tags.forEach((tag: string) => { @@ -130,17 +130,17 @@ describe('', () => { cy.wait('@getKeySet') cy.get('.kong-ui-entities-key-sets-form').should('be.visible') // default button state - cy.getTestId('set-form-cancel').should('be.visible') - cy.getTestId('set-form-submit').should('be.visible') - cy.getTestId('set-form-cancel').should('be.enabled') - cy.getTestId('set-form-submit').should('be.disabled') + cy.getTestId('set-edit-form-cancel').should('be.visible') + cy.getTestId('set-edit-form-submit').should('be.visible') + cy.getTestId('set-edit-form-cancel').should('be.enabled') + cy.getTestId('set-edit-form-submit').should('be.disabled') // enables save when form has changes cy.getTestId('key-set-form-name').type('-edited') - cy.getTestId('set-form-submit').should('be.enabled') + cy.getTestId('set-edit-form-submit').should('be.enabled') // disables save when form changes are undone cy.getTestId('key-set-form-name').clear() cy.getTestId('key-set-form-name').type(keySet1.name) - cy.getTestId('set-form-submit').should('be.disabled') + cy.getTestId('set-edit-form-submit').should('be.disabled') }) it('should handle error state - failed to load Key Set', () => { @@ -167,8 +167,8 @@ describe('', () => { // error state is displayed cy.getTestId('form-fetch-error').should('be.visible') // buttons and form hidden - cy.getTestId('set-form-cancel').should('not.exist') - cy.getTestId('set-form-submit').should('not.exist') + cy.getTestId('set-edit-form-cancel').should('not.exist') + cy.getTestId('set-edit-form-submit').should('not.exist') cy.get('.kong-ui-entities-key-sets-form form').should('not.exist') }) @@ -238,10 +238,10 @@ describe('', () => { cy.get('.kong-ui-entities-key-sets-form').should('be.visible') cy.get('.kong-ui-entities-key-sets-form form').should('be.visible') // button state - cy.getTestId('set-form-cancel').should('be.visible') - cy.getTestId('set-form-submit').should('be.visible') - cy.getTestId('set-form-cancel').should('be.enabled') - cy.getTestId('set-form-submit').should('be.disabled') + cy.getTestId('set-create-form-cancel').should('be.visible') + cy.getTestId('set-create-form-submit').should('be.visible') + cy.getTestId('set-create-form-cancel').should('be.enabled') + cy.getTestId('set-create-form-submit').should('be.disabled') // form fields cy.getTestId('key-set-form-name').should('be.visible') cy.getTestId('key-set-form-tags').should('be.visible') @@ -256,16 +256,16 @@ describe('', () => { cy.get('.kong-ui-entities-key-sets-form').should('be.visible') // default button state - cy.getTestId('set-form-cancel').should('be.visible') - cy.getTestId('set-form-submit').should('be.visible') - cy.getTestId('set-form-cancel').should('be.enabled') - cy.getTestId('set-form-submit').should('be.disabled') + cy.getTestId('set-create-form-cancel').should('be.visible') + cy.getTestId('set-create-form-submit').should('be.visible') + cy.getTestId('set-create-form-cancel').should('be.enabled') + cy.getTestId('set-create-form-submit').should('be.disabled') // enables save when required fields have values cy.getTestId('key-set-form-name').type('my-key-set') - cy.getTestId('set-form-submit').should('be.enabled') + cy.getTestId('set-create-form-submit').should('be.enabled') // disables save when required field is cleared cy.getTestId('key-set-form-name').clear() - cy.getTestId('set-form-submit').should('be.disabled') + cy.getTestId('set-create-form-submit').should('be.disabled') }) it('should show edit form', () => { @@ -281,10 +281,10 @@ describe('', () => { cy.wait('@getKeySet') cy.get('.kong-ui-entities-key-sets-form').should('be.visible') // button state - cy.getTestId('set-form-cancel').should('be.visible') - cy.getTestId('set-form-submit').should('be.visible') - cy.getTestId('set-form-cancel').should('be.enabled') - cy.getTestId('set-form-submit').should('be.disabled') + cy.getTestId('set-edit-form-submit').should('be.visible') + cy.getTestId('set-edit-form-submit').should('be.visible') + cy.getTestId('set-edit-form-submit').should('be.enabled') + cy.getTestId('set-edit-form-submit').should('be.disabled') // form fields cy.getTestId('key-set-form-name').should('have.value', keySet1.name) keySet1.tags.forEach((tag: string) => { @@ -307,17 +307,17 @@ describe('', () => { cy.wait('@getKeySet') cy.get('.kong-ui-entities-key-sets-form').should('be.visible') // default button state - cy.getTestId('set-form-cancel').should('be.visible') - cy.getTestId('set-form-submit').should('be.visible') - cy.getTestId('set-form-cancel').should('be.enabled') - cy.getTestId('set-form-submit').should('be.disabled') + cy.getTestId('set-edit-form-submit').should('be.visible') + cy.getTestId('set-edit-form-submit').should('be.visible') + cy.getTestId('set-edit-form-submit').should('be.enabled') + cy.getTestId('set-edit-form-submit').should('be.disabled') // enables save when form has changes cy.getTestId('key-set-form-name').type('-edited') - cy.getTestId('set-form-submit').should('be.enabled') + cy.getTestId('set-edit-form-submit').should('be.enabled') // disables save when form changes are undone cy.getTestId('key-set-form-name').clear() cy.getTestId('key-set-form-name').type(keySet1.name) - cy.getTestId('set-form-submit').should('be.disabled') + cy.getTestId('set-edit-form-submit').should('be.disabled') }) it('should handle error state - failed to load Key Set', () => { @@ -344,8 +344,8 @@ describe('', () => { // error state is displayed cy.getTestId('form-fetch-error').should('be.visible') // buttons and form hidden - cy.getTestId('set-form-cancel').should('not.exist') - cy.getTestId('set-form-submit').should('not.exist') + cy.getTestId('set-edit-form-submit').should('not.exist') + cy.getTestId('set-edit-form-submit').should('not.exist') cy.get('.kong-ui-entities-key-sets-form form').should('not.exist') }) diff --git a/packages/entities/entities-keys/src/components/KeyForm.cy.ts b/packages/entities/entities-keys/src/components/KeyForm.cy.ts index 2fe6ae9ed5..a8c0173ba2 100644 --- a/packages/entities/entities-keys/src/components/KeyForm.cy.ts +++ b/packages/entities/entities-keys/src/components/KeyForm.cy.ts @@ -96,10 +96,10 @@ describe('', () => { cy.get('.kong-ui-entities-keys-form').should('be.visible') cy.get('.kong-ui-entities-keys-form form').should('be.visible') // button state - cy.getTestId('key-form-cancel').should('be.visible') - cy.getTestId('key-form-submit').should('be.visible') - cy.getTestId('key-form-cancel').should('be.enabled') - cy.getTestId('key-form-submit').should('be.disabled') + cy.getTestId('key-create-form-cancel').should('be.visible') + cy.getTestId('key-create-form-submit').should('be.visible') + cy.getTestId('key-create-form-cancel').should('be.enabled') + cy.getTestId('key-create-form-submit').should('be.disabled') // form fields cy.getTestId('key-form-id').should('be.visible') cy.getTestId('key-form-name').should('be.visible') @@ -188,20 +188,20 @@ describe('', () => { cy.wait('@getKeySets') cy.get('.kong-ui-entities-keys-form').should('be.visible') // default button state - cy.getTestId('key-form-cancel').should('be.visible') - cy.getTestId('key-form-submit').should('be.visible') - cy.getTestId('key-form-cancel').should('be.enabled') - cy.getTestId('key-form-submit').should('be.disabled') + cy.getTestId('key-create-form-cancel').should('be.visible') + cy.getTestId('key-create-form-submit').should('be.visible') + cy.getTestId('key-create-form-cancel').should('be.enabled') + cy.getTestId('key-create-form-submit').should('be.disabled') // enables save when required fields have values cy.getTestId('key-form-id').type(kid) cy.getTestId('key-form-name').type('tk-meowstersmith') cy.getTestId('key-form-key-set').click() cy.get(`[data-testid="select-item-${keySets.data[0].id}"] button`).click() cy.getTestId('key-form-jwk').type(jwkString, { delay: 0 }) - cy.getTestId('key-form-submit').should('be.enabled') + cy.getTestId('key-create-form-submit').should('be.enabled') // disables save when required field is cleared cy.getTestId('key-form-id').clear() - cy.getTestId('key-form-submit').should('be.disabled') + cy.getTestId('key-create-form-submit').should('be.disabled') }) it('should pick correct url while creating global key', () => { @@ -220,7 +220,7 @@ describe('', () => { cy.getTestId('key-form-key-set').click() cy.get(`[data-testid="select-item-${keySets.data[0].id}"] button`).click() cy.getTestId('key-form-jwk').type(jwkString, { delay: 0 }) - cy.getTestId('key-form-submit').click() + cy.getTestId('key-create-form-submit').click() cy.wait('@createKey') }) @@ -242,7 +242,7 @@ describe('', () => { cy.getTestId('key-form-key-set').click() cy.get(`[data-testid="select-item-${keySets.data[0].id}"] button`).click() cy.getTestId('key-form-jwk').type(jwkString, { delay: 0 }) - cy.getTestId('key-form-submit').click() + cy.getTestId('key-edit-form-submit').click() cy.wait('@createKey') }) @@ -341,10 +341,10 @@ describe('', () => { cy.wait('@getKey') cy.get('.kong-ui-entities-keys-form').should('be.visible') // button state - cy.getTestId('key-form-cancel').should('be.visible') - cy.getTestId('key-form-submit').should('be.visible') - cy.getTestId('key-form-cancel').should('be.enabled') - cy.getTestId('key-form-submit').should('be.disabled') + cy.getTestId('key-edit-form-cancel').should('be.visible') + cy.getTestId('key-edit-form-submit').should('be.visible') + cy.getTestId('key-edit-form-cancel').should('be.enabled') + cy.getTestId('key-edit-form-submit').should('be.disabled') // form fields cy.getTestId('key-form-name').should('have.value', key1.name) key1.tags.forEach((tag: string) => { @@ -389,7 +389,7 @@ describe('', () => { cy.getTestId('key-form-tags').clear() cy.getTestId('key-form-tags').type('tag1,tag2') cy.getTestId('key-form-name').type('-edited') - cy.getTestId('key-form-submit').click() + cy.getTestId('key-edit-form-submit').click() cy.wait('@updateKey') }) @@ -411,7 +411,7 @@ describe('', () => { cy.getTestId('key-form-tags').clear() cy.getTestId('key-form-tags').type('tag1,tag2') cy.getTestId('key-form-name').type('-edited') - cy.getTestId('key-form-submit').click() + cy.getTestId('key-edit-form-submit').click() cy.wait('@updateKeysetKey') }) @@ -430,17 +430,17 @@ describe('', () => { cy.wait('@getKeySets') cy.get('.kong-ui-entities-keys-form').should('be.visible') // default button state - cy.getTestId('key-form-cancel').should('be.visible') - cy.getTestId('key-form-submit').should('be.visible') - cy.getTestId('key-form-cancel').should('be.enabled') - cy.getTestId('key-form-submit').should('be.disabled') + cy.getTestId('key-edit-form-cancel').should('be.visible') + cy.getTestId('key-edit-form-submit').should('be.visible') + cy.getTestId('key-edit-form-cancel').should('be.enabled') + cy.getTestId('key-edit-form-submit').should('be.disabled') // enables save when form has changes cy.getTestId('key-form-name').type('-edited') - cy.getTestId('key-form-submit').should('be.enabled') + cy.getTestId('key-edit-form-submit').should('be.enabled') // disables save when form changes are undone cy.getTestId('key-form-name').clear() cy.getTestId('key-form-name').type(key1.name) - cy.getTestId('key-form-submit').should('be.disabled') + cy.getTestId('key-edit-form-submit').should('be.disabled') }) it('should handle error state - failed to load Key', () => { @@ -470,8 +470,8 @@ describe('', () => { // error state is displayed cy.getTestId('form-fetch-error').should('be.visible') // buttons and form hidden - cy.getTestId('key-form-cancel').should('not.exist') - cy.getTestId('key-form-submit').should('not.exist') + cy.getTestId('key-edit-form-cancel').should('not.exist') + cy.getTestId('key-edit-form-submit').should('not.exist') cy.get('.kong-ui-entities-keys-form form').should('not.exist') }) @@ -617,10 +617,10 @@ describe('', () => { cy.get('.kong-ui-entities-keys-form').should('be.visible') cy.get('.kong-ui-entities-keys-form form').should('be.visible') // button state - cy.getTestId('key-form-cancel').should('be.visible') - cy.getTestId('key-form-submit').should('be.visible') - cy.getTestId('key-form-cancel').should('be.enabled') - cy.getTestId('key-form-submit').should('be.disabled') + cy.getTestId('key-create-form-cancel').should('be.visible') + cy.getTestId('key-create-form-submit').should('be.visible') + cy.getTestId('key-create-form-cancel').should('be.enabled') + cy.getTestId('key-create-form-submit').should('be.disabled') // form fields cy.getTestId('key-form-id').should('be.visible') cy.getTestId('key-form-name').should('be.visible') @@ -709,20 +709,20 @@ describe('', () => { cy.wait('@getKeySets') cy.get('.kong-ui-entities-keys-form').should('be.visible') // default button state - cy.getTestId('key-form-cancel').should('be.visible') - cy.getTestId('key-form-submit').should('be.visible') - cy.getTestId('key-form-cancel').should('be.enabled') - cy.getTestId('key-form-submit').should('be.disabled') + cy.getTestId('key-create-form-cancel').should('be.visible') + cy.getTestId('key-create-form-submit').should('be.visible') + cy.getTestId('key-create-form-cancel').should('be.enabled') + cy.getTestId('key-create-form-submit').should('be.disabled') // enables save when required fields have values cy.getTestId('key-form-id').type(kid) cy.getTestId('key-form-name').type('tk-meowstersmith') cy.getTestId('key-form-key-set').click() cy.get(`[data-testid="select-item-${keySets.data[0].id}"] button`).click() cy.getTestId('key-form-jwk').type(jwkString, { delay: 0 }) - cy.getTestId('key-form-submit').should('be.enabled') + cy.getTestId('key-create-form-submit').should('be.enabled') // disables save when required field is cleared cy.getTestId('key-form-id').clear() - cy.getTestId('key-form-submit').should('be.disabled') + cy.getTestId('key-create-form-submit').should('be.disabled') }) it('should pick correct url while creating global key', () => { @@ -741,7 +741,7 @@ describe('', () => { cy.getTestId('key-form-key-set').click() cy.get(`[data-testid="select-item-${keySets.data[0].id}"] button`).click() cy.getTestId('key-form-jwk').type(jwkString, { delay: 0 }) - cy.getTestId('key-form-submit').click() + cy.getTestId('key-create-form-submit').click() cy.wait('@createKey') }) @@ -763,7 +763,7 @@ describe('', () => { cy.getTestId('key-form-key-set').click() cy.get(`[data-testid="select-item-${keySets.data[0].id}"] button`).click() cy.getTestId('key-form-jwk').type(jwkString, { delay: 0 }) - cy.getTestId('key-form-submit').click() + cy.getTestId('key-edit-form-submit').click() cy.wait('@createKey') }) @@ -862,10 +862,10 @@ describe('', () => { cy.wait('@getKey') cy.get('.kong-ui-entities-keys-form').should('be.visible') // button state - cy.getTestId('key-form-cancel').should('be.visible') - cy.getTestId('key-form-submit').should('be.visible') - cy.getTestId('key-form-cancel').should('be.enabled') - cy.getTestId('key-form-submit').should('be.disabled') + cy.getTestId('key-edit-form-cancel').should('be.visible') + cy.getTestId('key-edit-form-submit').should('be.visible') + cy.getTestId('key-edit-form-cancel').should('be.enabled') + cy.getTestId('key-edit-form-submit').should('be.disabled') // form fields cy.getTestId('key-form-name').should('have.value', key1.name) key1.tags.forEach((tag: string) => { @@ -910,7 +910,7 @@ describe('', () => { cy.getTestId('key-form-tags').clear() cy.getTestId('key-form-tags').type('tag1,tag2') cy.getTestId('key-form-name').type('-edited') - cy.getTestId('key-form-submit').click() + cy.getTestId('key-edit-form-submit').click() cy.wait('@updateKey') }) @@ -932,7 +932,7 @@ describe('', () => { cy.getTestId('key-form-tags').clear() cy.getTestId('key-form-tags').type('tag1,tag2') cy.getTestId('key-form-name').type('-edited') - cy.getTestId('key-form-submit').click() + cy.getTestId('key-edit-form-submit').click() cy.wait('@updateKeysetKey') }) @@ -951,17 +951,17 @@ describe('', () => { cy.wait('@getKeySets') cy.get('.kong-ui-entities-keys-form').should('be.visible') // default button state - cy.getTestId('key-form-cancel').should('be.visible') - cy.getTestId('key-form-submit').should('be.visible') - cy.getTestId('key-form-cancel').should('be.enabled') - cy.getTestId('key-form-submit').should('be.disabled') + cy.getTestId('key-edit-form-cancel').should('be.visible') + cy.getTestId('key-edit-form-submit').should('be.visible') + cy.getTestId('key-edit-form-cancel').should('be.enabled') + cy.getTestId('key-edit-form-submit').should('be.disabled') // enables save when form has changes cy.getTestId('key-form-name').type('-edited') - cy.getTestId('key-form-submit').should('be.enabled') + cy.getTestId('key-edit-form-submit').should('be.enabled') // disables save when form changes are undone cy.getTestId('key-form-name').clear() cy.getTestId('key-form-name').type(key1.name) - cy.getTestId('key-form-submit').should('be.disabled') + cy.getTestId('key-edit-form-submit').should('be.disabled') }) it('should handle error state - failed to load Key', () => { @@ -990,8 +990,8 @@ describe('', () => { // error state is displayed cy.getTestId('form-fetch-error').should('be.visible') // buttons and form hidden - cy.getTestId('key-form-cancel').should('not.exist') - cy.getTestId('key-form-submit').should('not.exist') + cy.getTestId('key-edit-form-cancel').should('not.exist') + cy.getTestId('key-edit-form-submit').should('not.exist') cy.get('.kong-ui-entities-keys-form form').should('not.exist') }) diff --git a/packages/entities/entities-plugins/src/components/PluginForm.cy.ts b/packages/entities/entities-plugins/src/components/PluginForm.cy.ts index 0faf4aa6db..86e29d8763 100644 --- a/packages/entities/entities-plugins/src/components/PluginForm.cy.ts +++ b/packages/entities/entities-plugins/src/components/PluginForm.cy.ts @@ -187,9 +187,9 @@ describe('', () => { cy.get('.kong-ui-entities-plugin-form-container').should('be.visible') // button state - cy.getTestId('plugin-form-submit').should('be.visible') - cy.getTestId('plugin-form-submit').should('be.enabled') - cy.getTestId('plugin-form-cancel').should('be.visible') + cy.getTestId('plugin-create-form-submit').should('be.visible') + cy.getTestId('plugin-create-form-submit').should('be.enabled') + cy.getTestId('plugin-create-form-cancel').should('be.visible') // pinned fields (but they should not be under a KCollapse) cy.get('#enabled').should('exist') @@ -258,9 +258,9 @@ describe('', () => { cy.get('.kong-ui-entities-plugin-form-container').should('be.visible') // button state - cy.getTestId('plugin-form-submit').should('be.visible') - cy.getTestId('plugin-form-submit').should('be.enabled') - cy.getTestId('plugin-form-cancel').should('be.visible') + cy.getTestId('plugin-create-form-submit').should('be.visible') + cy.getTestId('plugin-create-form-submit').should('be.enabled') + cy.getTestId('plugin-create-form-cancel').should('be.visible') // pinned fields (but they should not be under a KCollapse) cy.get('#enabled').should('exist') @@ -339,9 +339,9 @@ describe('', () => { cy.get('.kong-ui-entities-plugin-form-container').should('be.visible') // button state - cy.getTestId('plugin-form-submit').should('be.visible') - cy.getTestId('plugin-form-submit').should('be.enabled') - cy.getTestId('plugin-form-cancel').should('be.visible') + cy.getTestId('plugin-create-form-submit').should('be.visible') + cy.getTestId('plugin-create-form-submit').should('be.enabled') + cy.getTestId('plugin-create-form-cancel').should('be.visible') // scope fields cy.get('.field-selectionGroup').should('be.visible') @@ -426,8 +426,8 @@ describe('', () => { cy.wait('@getPluginSchema') cy.get('.kong-ui-entities-plugin-form-container').should('be.visible') - cy.getTestId('plugin-form-submit').should('not.exist') - cy.getTestId('plugin-form-cancel').should('not.exist') + cy.getTestId('plugin-create-form-submit').should('not.exist') + cy.getTestId('plugin-create-form-cancel').should('not.exist') }) it('should show create form - acl credential', () => { @@ -450,9 +450,9 @@ describe('', () => { cy.wait('@getPluginSchema') // button state - cy.getTestId('plugin-form-submit').should('be.visible') - cy.getTestId('plugin-form-submit').should('be.enabled') - cy.getTestId('plugin-form-cancel').should('be.visible') + cy.getTestId('plugin-create-form-submit').should('be.visible') + cy.getTestId('plugin-create-form-submit').should('be.enabled') + cy.getTestId('plugin-create-form-cancel').should('be.visible') // scope & global fields cy.get('.field-selectionGroup').should('not.exist') @@ -518,7 +518,7 @@ describe('', () => { cy.get('#instance_name').type('kai_cors_plugin') cy.get('#tags').type('tag1,tag2') - cy.getTestId('plugin-form-submit').click() + cy.getTestId('plugin-create-form-submit').click() cy.wait(['@validatePlugin', '@createPlugin']) }) @@ -545,7 +545,7 @@ describe('', () => { cy.get('#group').type('kai_group') cy.get('#tags').type('tag1,tag2') - cy.getTestId('plugin-form-submit').click() + cy.getTestId('plugin-create-form-submit').click() cy.wait('@createPlugin') }) @@ -575,9 +575,9 @@ describe('', () => { cy.get('.kong-ui-entities-plugin-form-container').should('be.visible') // button state - cy.getTestId('plugin-form-submit').should('be.visible') - cy.getTestId('plugin-form-submit').should('be.disabled') - cy.getTestId('plugin-form-cancel').should('be.visible') + cy.getTestId('plugin-edit-form-submit').should('be.visible') + cy.getTestId('plugin-edit-form-submit').should('be.disabled') + cy.getTestId('plugin-edit-form-cancel').should('be.visible') // reveal advanced fields cy.get('.k-collapse.nested-collapse [data-testid="collapse-trigger-label"]') @@ -647,7 +647,7 @@ describe('', () => { cy.get('#tags').clear() - cy.getTestId('plugin-form-submit').click() + cy.getTestId('plugin-edit-form-submit').click() cy.wait(['@validatePlugin', '@updatePlugin']) }) @@ -676,7 +676,7 @@ describe('', () => { cy.get('#group').type('-edited') - cy.getTestId('plugin-form-submit').click() + cy.getTestId('plugin-edit-form-submit').click() cy.wait('@updatePlugin') }) }) @@ -707,10 +707,10 @@ describe('', () => { cy.get('.kong-ui-entities-plugin-form-container').should('be.visible') // default button state - cy.getTestId('plugin-form-cancel').should('be.visible') - cy.getTestId('plugin-form-submit').should('be.visible') - cy.getTestId('plugin-form-cancel').should('be.enabled') - cy.getTestId('plugin-form-submit').should('be.disabled') + cy.getTestId('plugin-edit-form-cancel').should('be.visible') + cy.getTestId('plugin-edit-form-submit').should('be.visible') + cy.getTestId('plugin-edit-form-cancel').should('be.enabled') + cy.getTestId('plugin-edit-form-submit').should('be.disabled') // reveal advanced fields cy.get('.k-collapse.nested-collapse [data-testid="collapse-trigger-label"]') @@ -722,11 +722,11 @@ describe('', () => { // enables save when form has changes cy.get('#instance_name').type('-edited') - cy.getTestId('plugin-form-submit').should('be.enabled') + cy.getTestId('plugin-edit-form-submit').should('be.enabled') // disables save when form changes are undone cy.get('#instance_name').clear() cy.get('#instance_name').type(plugin1.instance_name) - cy.getTestId('plugin-form-submit').should('be.disabled') + cy.getTestId('plugin-edit-form-submit').should('be.disabled') }) }) @@ -761,8 +761,8 @@ describe('', () => { cy.getTestId('plugin-form-schema-error').should('be.visible') // buttons and form hidden - cy.getTestId('plugin-form-cancel').should('not.exist') - cy.getTestId('plugin-form-submit').should('not.exist') + cy.getTestId('plugin-create-form-cancel').should('not.exist') + cy.getTestId('plugin-create-form-submit').should('not.exist') cy.get('.kong-ui-entities-plugin-form-container form').should('not.exist') }) @@ -796,8 +796,8 @@ describe('', () => { cy.getTestId('form-fetch-error').should('be.visible') // buttons and form hidden - cy.getTestId('plugin-form-cancel').should('not.exist') - cy.getTestId('plugin-form-submit').should('not.exist') + cy.getTestId('plugin-edit-form-cancel').should('not.exist') + cy.getTestId('plugin-edit-form-submit').should('not.exist') cy.get('.kong-ui-entities-plugin-form-container form').should('not.exist') }) }) @@ -839,7 +839,7 @@ describe('', () => { cy.wait('@getPluginSchema') cy.get('.kong-ui-entities-plugin-form-container').should('be.visible') - cy.getTestId('plugin-form-submit').click() + cy.getTestId('plugin-create-form-submit').click() cy.wait('@validate') cy.getTestId('form-error').should('be.visible') @@ -879,7 +879,7 @@ describe('', () => { cy.get('#tags').clear() cy.get('#tags').type('tag1,tag2') - cy.getTestId('plugin-form-submit').click() + cy.getTestId('plugin-edit-form-submit').click() cy.wait(['@validatePlugin', '@updatePlugin']) @@ -1041,9 +1041,9 @@ describe('', () => { cy.get('.kong-ui-entities-plugin-form-container').should('be.visible') // button state - cy.getTestId('plugin-form-submit').should('be.visible') - cy.getTestId('plugin-form-submit').should('be.enabled') - cy.getTestId('plugin-form-cancel').should('be.visible') + cy.getTestId('plugin-create-form-submit').should('be.visible') + cy.getTestId('plugin-create-form-submit').should('be.enabled') + cy.getTestId('plugin-create-form-cancel').should('be.visible') // pinned fields (but they should not be under a KCollapse) cy.get('#enabled').should('exist') @@ -1113,9 +1113,9 @@ describe('', () => { cy.get('.kong-ui-entities-plugin-form-container').should('be.visible') // button state - cy.getTestId('plugin-form-submit').should('be.visible') - cy.getTestId('plugin-form-submit').should('be.enabled') - cy.getTestId('plugin-form-cancel').should('be.visible') + cy.getTestId('plugin-create-form-submit').should('be.visible') + cy.getTestId('plugin-create-form-submit').should('be.enabled') + cy.getTestId('plugin-create-form-cancel').should('be.visible') // pinned fields (but they should not be under a KCollapse) cy.get('#enabled').should('exist') @@ -1195,9 +1195,9 @@ describe('', () => { cy.get('.kong-ui-entities-plugin-form-container').should('be.visible') // button state - cy.getTestId('plugin-form-submit').should('be.visible') - cy.getTestId('plugin-form-submit').should('be.enabled') - cy.getTestId('plugin-form-cancel').should('be.visible') + cy.getTestId('plugin-create-form-submit').should('be.visible') + cy.getTestId('plugin-create-form-submit').should('be.enabled') + cy.getTestId('plugin-create-form-cancel').should('be.visible') // scope fields cy.get('.field-selectionGroup').should('be.visible') @@ -1285,8 +1285,8 @@ describe('', () => { cy.wait('@getPluginSchema') cy.get('.kong-ui-entities-plugin-form-container').should('be.visible') - cy.getTestId('plugin-form-submit').should('not.exist') - cy.getTestId('plugin-form-cancel').should('not.exist') + cy.getTestId('plugin-create-form-submit').should('not.exist') + cy.getTestId('plugin-create-form-cancel').should('not.exist') }) it('should hide instance name field if useCustomNamesForPlugin is false', () => { @@ -1326,9 +1326,9 @@ describe('', () => { cy.get('.kong-ui-entities-plugin-form-container').should('be.visible') // button state - cy.getTestId('plugin-form-submit').should('be.visible') - cy.getTestId('plugin-form-submit').should('be.enabled') - cy.getTestId('plugin-form-cancel').should('be.visible') + cy.getTestId('plugin-create-form-submit').should('be.visible') + cy.getTestId('plugin-create-form-submit').should('be.enabled') + cy.getTestId('plugin-create-form-cancel').should('be.visible') // scope & global fields cy.get('.field-selectionGroup').should('not.exist') @@ -1396,7 +1396,7 @@ describe('', () => { cy.get('#instance_name').type('kai_cors_plugin') cy.get('#tags').type('tag1,tag2') - cy.getTestId('plugin-form-submit').click() + cy.getTestId('plugin-create-form-submit').click() cy.wait(['@validatePlugin', '@createPlugin']) }) @@ -1421,7 +1421,7 @@ describe('', () => { cy.get('#group').type('kai_group') cy.get('#tags').type('tag1,tag2') - cy.getTestId('plugin-form-submit').click() + cy.getTestId('plugin-create-form-submit').click() cy.wait('@createPlugin') }) @@ -1452,9 +1452,9 @@ describe('', () => { cy.get('.kong-ui-entities-plugin-form-container').should('be.visible') // button state - cy.getTestId('plugin-form-submit').should('be.visible') - cy.getTestId('plugin-form-submit').should('be.disabled') - cy.getTestId('plugin-form-cancel').should('be.visible') + cy.getTestId('plugin-edit-form-submit').should('be.visible') + cy.getTestId('plugin-edit-form-submit').should('be.disabled') + cy.getTestId('plugin-edit-form-cancel').should('be.visible') // reveal advanced fields cy.get('.k-collapse.nested-collapse [data-testid="collapse-trigger-label"]') @@ -1525,7 +1525,7 @@ describe('', () => { cy.get('#tags').clear() - cy.getTestId('plugin-form-submit').click() + cy.getTestId('plugin-edit-form-submit').click() cy.wait(['@validatePlugin', '@updatePlugin']) }) }) @@ -1554,7 +1554,7 @@ describe('', () => { cy.get('#group').type('-edited') - cy.getTestId('plugin-form-submit').click() + cy.getTestId('plugin-edit-form-submit').click() cy.wait('@updatePlugin') }) @@ -1585,10 +1585,10 @@ describe('', () => { cy.get('.kong-ui-entities-plugin-form-container').should('be.visible') // default button state - cy.getTestId('plugin-form-cancel').should('be.visible') - cy.getTestId('plugin-form-submit').should('be.visible') - cy.getTestId('plugin-form-cancel').should('be.enabled') - cy.getTestId('plugin-form-submit').should('be.disabled') + cy.getTestId('plugin-edit-form-cancel').should('be.visible') + cy.getTestId('plugin-edit-form-submit').should('be.visible') + cy.getTestId('plugin-edit-form-cancel').should('be.enabled') + cy.getTestId('plugin-edit-form-submit').should('be.disabled') // reveal advanced fields cy.get('.k-collapse.nested-collapse [data-testid="collapse-trigger-label"]') @@ -1600,11 +1600,11 @@ describe('', () => { // enables save when form has changes cy.get('#instance_name').type('-edited') - cy.getTestId('plugin-form-submit').should('be.enabled') + cy.getTestId('plugin-edit-form-submit').should('be.enabled') // disables save when form changes are undone cy.get('#instance_name').clear() cy.get('#instance_name').type(plugin1.instance_name) - cy.getTestId('plugin-form-submit').should('be.disabled') + cy.getTestId('plugin-edit-form-submit').should('be.disabled') }) }) @@ -1640,8 +1640,8 @@ describe('', () => { cy.getTestId('plugin-form-schema-error').should('be.visible') // buttons and form hidden - cy.getTestId('plugin-form-cancel').should('not.exist') - cy.getTestId('plugin-form-submit').should('not.exist') + cy.getTestId('plugin-create-form-cancel').should('not.exist') + cy.getTestId('plugin-create-form-submit').should('not.exist') cy.get('.kong-ui-entities-plugin-form-container form').should('not.exist') }) @@ -1676,8 +1676,8 @@ describe('', () => { cy.getTestId('form-fetch-error').should('be.visible') // buttons and form hidden - cy.getTestId('plugin-form-cancel').should('not.exist') - cy.getTestId('plugin-form-submit').should('not.exist') + cy.getTestId('plugin-edit-form-cancel').should('not.exist') + cy.getTestId('plugin-edit-form-submit').should('not.exist') cy.get('.kong-ui-entities-plugin-form-container form').should('not.exist') }) }) @@ -1720,7 +1720,7 @@ describe('', () => { cy.wait('@getPluginSchema') cy.get('.kong-ui-entities-plugin-form-container').should('be.visible') - cy.getTestId('plugin-form-submit').click() + cy.getTestId('plugin-create-form-submit').click() cy.wait('@validate') cy.getTestId('form-error').should('be.visible') @@ -1761,7 +1761,7 @@ describe('', () => { cy.get('#tags').clear() cy.get('#tags').type('tag1,tag2') - cy.getTestId('plugin-form-submit').click() + cy.getTestId('plugin-edit-form-submit').click() cy.wait(['@validatePlugin', '@updatePlugin']).then(() => { cy.get('@onUpdateSpy').should('have.been.calledOnce') diff --git a/packages/entities/entities-plugins/src/components/PluginForm.vue b/packages/entities/entities-plugins/src/components/PluginForm.vue index a0abcf70c3..be800530a7 100644 --- a/packages/entities/entities-plugins/src/components/PluginForm.vue +++ b/packages/entities/entities-plugins/src/components/PluginForm.vue @@ -68,7 +68,7 @@ {{ t('actions.view_configuration') }} @@ -76,7 +76,7 @@ !!props.pluginId) const formType = computed((): EntityBaseFormType => props.pluginId ? EntityBaseFormType.Edit : EntityBaseFormType.Create) const schema = ref | null>(null) const treatAsCredential = computed((): boolean => !!(props.credential && props.config.entityId)) diff --git a/packages/entities/entities-routes/src/components/RouteForm.cy.ts b/packages/entities/entities-routes/src/components/RouteForm.cy.ts index 173e9aa9d6..1a4f7651b2 100644 --- a/packages/entities/entities-routes/src/components/RouteForm.cy.ts +++ b/packages/entities/entities-routes/src/components/RouteForm.cy.ts @@ -118,10 +118,10 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { cy.get('.kong-ui-entities-route-form form').should('be.visible') // button state - cy.getTestId('route-form-cancel').should('be.visible') - cy.getTestId('route-form-submit').should('be.visible') - cy.getTestId('route-form-cancel').should('be.enabled') - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-create-form-cancel').should('be.visible') + cy.getTestId('route-create-form-submit').should('be.visible') + cy.getTestId('route-create-form-cancel').should('be.enabled') + cy.getTestId('route-create-form-submit').should('be.disabled') // config tabs is hidden when there is only one tab cy.getTestId('route-form-config-tabs') @@ -305,10 +305,10 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { } // else: we will be on the trad tab by default // default button state - cy.getTestId('route-form-cancel').should('be.visible') - cy.getTestId('route-form-submit').should('be.visible') - cy.getTestId('route-form-cancel').should('be.enabled') - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-create-form-cancel').should('be.visible') + cy.getTestId('route-create-form-submit').should('be.visible') + cy.getTestId('route-create-form-cancel').should('be.enabled') + cy.getTestId('route-create-form-submit').should('be.disabled') // config tabs is hidden when there is only one tab cy.getTestId('route-form-config-tabs') @@ -320,56 +320,56 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { // paths cy.getTestId('route-form-paths-input-1').type(route.paths[0]) - cy.getTestId('route-form-submit').should('be.enabled').click() + cy.getTestId('route-create-form-submit').should('be.enabled').click() cy.wait('@createRoute').then((res) => res.response?.body?.kind).should('eq', 'trad') cy.getTestId('route-form-paths-input-1').clear() - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-create-form-submit').should('be.disabled') // snis cy.getTestId('routing-rule-snis').click() cy.getTestId('route-form-snis-input-1').type('sni') - cy.getTestId('route-form-submit').should('be.enabled').click() + cy.getTestId('route-create-form-submit').should('be.enabled').click() cy.wait('@createRoute').then((res) => res.response?.body?.kind).should('eq', 'trad') cy.getTestId('route-form-snis-input-1').clear() - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-create-form-submit').should('be.disabled') // hosts cy.getTestId('routing-rule-hosts').click() cy.getTestId('route-form-hosts-input-1').type('host') - cy.getTestId('route-form-submit').should('be.enabled').click() + cy.getTestId('route-create-form-submit').should('be.enabled').click() cy.wait('@createRoute').then((res) => res.response?.body?.kind).should('eq', 'trad') cy.getTestId('route-form-hosts-input-1').clear() - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-create-form-submit').should('be.disabled') // methods and custom methods cy.getTestId('routing-rule-methods').click() cy.getTestId('get-method-toggle').check({ force: true }) - cy.getTestId('route-form-submit').should('be.enabled').click() + cy.getTestId('route-create-form-submit').should('be.enabled').click() cy.wait('@createRoute').then((res) => res.response?.body?.kind).should('eq', 'trad') cy.getTestId('get-method-toggle').uncheck({ force: true }) - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-create-form-submit').should('be.disabled') cy.getTestId('custom-method-toggle').check({ force: true }) - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-create-form-submit').should('be.disabled') cy.getTestId('route-form-custom-method-input-1').type('castom') - cy.getTestId('route-form-submit').should('be.enabled').click() + cy.getTestId('route-create-form-submit').should('be.enabled').click() cy.wait('@createRoute').then((res) => res.response?.body?.kind).should('eq', 'trad') cy.getTestId('route-form-custom-method-input-1').clear() - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-create-form-submit').should('be.disabled') // headers cy.getTestId('routing-rule-headers').click() cy.getTestId('route-form-headers-name-input-1').type(Object.keys(route.headers)[0]) - cy.getTestId('route-form-submit').should('be.enabled').click() + cy.getTestId('route-create-form-submit').should('be.enabled').click() cy.wait('@createRoute').then((res) => res.response?.body?.kind).should('eq', 'trad') cy.getTestId('route-form-headers-name-input-1').clear() cy.getTestId('route-form-headers-values-input-1').type(route.headers.Header1[0]) - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-create-form-submit').should('be.disabled') cy.getTestId('route-form-protocols').click({ force: true }) cy.get("[data-testid='select-item-tcp,tls,udp']").click({ force: true }) @@ -377,22 +377,22 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { // sources cy.getTestId('routing-rule-sources').click() cy.getTestId('route-form-sources-ip-input-1').type('127.0.0.1') - cy.getTestId('route-form-submit').should('be.enabled').click() + cy.getTestId('route-create-form-submit').should('be.enabled').click() cy.wait('@createRoute').then((res) => res.response?.body?.kind).should('eq', 'trad') cy.getTestId('route-form-sources-ip-input-1').clear() cy.getTestId('route-form-sources-port-input-1').type('8080') - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-create-form-submit').should('be.disabled') // destinations cy.getTestId('routing-rule-destinations').click() cy.getTestId('route-form-destinations-ip-input-1').type('127.0.0.2') - cy.getTestId('route-form-submit').should('be.enabled').click() + cy.getTestId('route-create-form-submit').should('be.enabled').click() cy.wait('@createRoute').then((res) => res.response?.body?.kind).should('eq', 'trad') cy.getTestId('route-form-destinations-ip-input-1').clear() cy.getTestId('route-form-destinations-port-input-1').type('8000') - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-create-form-submit').should('be.disabled') }) } // if !routeFlavors || routeFlavors?.traditional @@ -418,15 +418,15 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { } // else: we will be on expr tab by default // default button state - cy.getTestId('route-form-cancel').should('be.visible') - cy.getTestId('route-form-submit').should('be.visible') - cy.getTestId('route-form-cancel').should('be.enabled') - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-create-form-cancel').should('be.visible') + cy.getTestId('route-create-form-submit').should('be.visible') + cy.getTestId('route-create-form-cancel').should('be.enabled') + cy.getTestId('route-create-form-submit').should('be.disabled') // enables save when required fields have values // form fields - general cy.getTestId('route-form-name').should('be.visible') - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-create-form-submit').should('be.disabled') // the editor shows invalid because it is empty cy.get('.expression-editor').should('have.class', 'invalid') @@ -438,7 +438,7 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { // it should be no longer invalid cy.get('.expression-editor').should('not.have.class', 'invalid') // and the submit button is enabled - cy.getTestId('route-form-submit').should('be.enabled').click() + cy.getTestId('route-create-form-submit').should('be.enabled').click() cy.wait('@createRoute').then((res) => res.response?.body?.kind).should('eq', 'expr') // delete the last character @@ -447,7 +447,7 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { // invalid again cy.get('.expression-editor').should('have.class', 'invalid') // but the submit button is still enabled because we let the server handle uncaught errors - cy.getTestId('route-form-submit').should('be.enabled').click() + cy.getTestId('route-create-form-submit').should('be.enabled').click() cy.wait('@createRoute').then((res) => res.response?.body?.kind).should('eq', 'expr') }) } // if routeFlavors?.expressions @@ -472,10 +472,10 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { cy.get('.kong-ui-entities-route-form').should('be.visible') // button state - cy.getTestId('route-form-cancel').should('be.visible') - cy.getTestId('route-form-submit').should('be.visible') - cy.getTestId('route-form-cancel').should('be.enabled') - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-edit-form-cancel').should('be.visible') + cy.getTestId('route-edit-form-submit').should('be.visible') + cy.getTestId('route-edit-form-cancel').should('be.enabled') + cy.getTestId('route-edit-form-submit').should('be.disabled') if (routeFlavors?.traditional && routeFlavors?.expressions) { // trad tab should be active by default @@ -529,10 +529,10 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { cy.get('.kong-ui-entities-route-form').should('be.visible') // default button state - cy.getTestId('route-form-cancel').should('be.visible') - cy.getTestId('route-form-submit').should('be.visible') - cy.getTestId('route-form-cancel').should('be.enabled') - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-edit-form-cancel').should('be.visible') + cy.getTestId('route-edit-form-submit').should('be.visible') + cy.getTestId('route-edit-form-cancel').should('be.enabled') + cy.getTestId('route-edit-form-submit').should('be.disabled') if (routeFlavors?.traditional && routeFlavors?.expressions) { // trad tab should be active by default @@ -544,7 +544,7 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { // enables save when form has changes cy.getTestId('route-form-service-id').click({ force: true }) cy.get("[data-testid='select-item-2']").click() - cy.getTestId('route-form-submit').should('be.enabled').click() + cy.getTestId('route-edit-form-submit').should('be.enabled').click() cy.wait('@editRoute').then((res) => res.response?.body?.kind).should('eq', 'trad') cy.getTestId('remove-methods').click() @@ -552,7 +552,7 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { cy.getTestId('remove-paths').click() cy.getTestId('remove-headers').click() cy.getTestId('routing-rules-warning').should('be.visible') - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-edit-form-submit').should('be.disabled') }) } // if !routeFlavors || routeFlavors?.traditional @@ -576,10 +576,10 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { cy.get('.kong-ui-entities-route-form').should('be.visible') // button state - cy.getTestId('route-form-cancel').should('be.visible') - cy.getTestId('route-form-submit').should('be.visible') - cy.getTestId('route-form-cancel').should('be.enabled') - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-edit-form-cancel').should('be.visible') + cy.getTestId('route-edit-form-submit').should('be.visible') + cy.getTestId('route-edit-form-cancel').should('be.enabled') + cy.getTestId('route-edit-form-submit').should('be.disabled') if (routeFlavors?.traditional && routeFlavors?.expressions) { // expr tab should be active by default @@ -622,10 +622,10 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { cy.get('.kong-ui-entities-route-form').should('be.visible') // default button state - cy.getTestId('route-form-cancel').should('be.visible') - cy.getTestId('route-form-submit').should('be.visible') - cy.getTestId('route-form-cancel').should('be.enabled') - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-edit-form-cancel').should('be.visible') + cy.getTestId('route-edit-form-submit').should('be.visible') + cy.getTestId('route-edit-form-cancel').should('be.enabled') + cy.getTestId('route-edit-form-submit').should('be.disabled') if (routeFlavors?.traditional && routeFlavors?.expressions) { // trad tab should be active by default @@ -636,7 +636,7 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { // enables save when form has changes cy.getTestId('route-form-service-id').click({ force: true }) cy.get("[data-testid='select-item-2']").click() - cy.getTestId('route-form-submit').should('be.enabled').click() + cy.getTestId('route-edit-form-submit').should('be.enabled').click() cy.wait('@editRoute').then((res) => res.response?.body?.kind).should('eq', 'expr') // type a valid expression @@ -647,7 +647,7 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { // the editor should become invalid cy.get('.expression-editor').should('have.class', 'invalid') // but the submit button is still enabled because we let the server handle uncaught errors - cy.getTestId('route-form-submit').should('be.enabled').click() + cy.getTestId('route-edit-form-submit').should('be.enabled').click() cy.wait('@editRoute').then((res) => res.response?.body?.kind).should('eq', 'expr') }) } // if routeFlavors?.expressions @@ -683,8 +683,8 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { cy.getTestId('form-fetch-error').should('be.visible') // buttons and form hidden - cy.getTestId('route-form-cancel').should('not.exist') - cy.getTestId('route-form-submit').should('not.exist') + cy.getTestId('route-edit-form-cancel').should('not.exist') + cy.getTestId('route-edit-form-submit').should('not.exist') cy.get('.kong-ui-entities-route-form form').should('not.exist') }) @@ -776,8 +776,8 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { cy.get('.form-section-info sticky').should('not.exist') // default buttons should be replaced with slotted content - cy.getTestId('route-form-cancel').should('not.exist') - cy.getTestId('route-form-submit').should('not.exist') + cy.getTestId('route-create-form-cancel').should('not.exist') + cy.getTestId('route-create-form-submit').should('not.exist') cy.getTestId('slotted-cancel-button').should('be.visible') cy.getTestId('slotted-submit-button').should('be.visible') }) @@ -999,10 +999,10 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { cy.get('.kong-ui-entities-route-form form').should('be.visible') // button state - cy.getTestId('route-form-cancel').should('be.visible') - cy.getTestId('route-form-submit').should('be.visible') - cy.getTestId('route-form-cancel').should('be.enabled') - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-create-form-cancel').should('be.visible') + cy.getTestId('route-create-form-submit').should('be.visible') + cy.getTestId('route-create-form-cancel').should('be.enabled') + cy.getTestId('route-create-form-submit').should('be.disabled') // config tabs is hidden when there is only one tab cy.getTestId('route-form-config-tabs') @@ -1164,10 +1164,10 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { } // else: we will be on the trad tab by default // default button state - cy.getTestId('route-form-cancel').should('be.visible') - cy.getTestId('route-form-submit').should('be.visible') - cy.getTestId('route-form-cancel').should('be.enabled') - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-create-form-cancel').should('be.visible') + cy.getTestId('route-create-form-submit').should('be.visible') + cy.getTestId('route-create-form-cancel').should('be.enabled') + cy.getTestId('route-create-form-submit').should('be.disabled') // config tabs is hidden when there is only one tab cy.getTestId('route-form-config-tabs') @@ -1179,56 +1179,56 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { // paths cy.getTestId('route-form-paths-input-1').type(route.paths[0]) - cy.getTestId('route-form-submit').should('be.enabled').click() + cy.getTestId('route-create-form-submit').should('be.enabled').click() cy.wait('@createRoute').then((res) => res.response?.body?.kind).should('eq', 'trad') cy.getTestId('route-form-paths-input-1').clear() - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-create-form-submit').should('be.disabled') // snis cy.getTestId('routing-rule-snis').click() cy.getTestId('route-form-snis-input-1').type('sni') - cy.getTestId('route-form-submit').should('be.enabled').click() + cy.getTestId('route-create-form-submit').should('be.enabled').click() cy.wait('@createRoute').then((res) => res.response?.body?.kind).should('eq', 'trad') cy.getTestId('route-form-snis-input-1').clear() - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-create-form-submit').should('be.disabled') // hosts cy.getTestId('routing-rule-hosts').click() cy.getTestId('route-form-hosts-input-1').type('host') - cy.getTestId('route-form-submit').should('be.enabled').click() + cy.getTestId('route-create-form-submit').should('be.enabled').click() cy.wait('@createRoute').then((res) => res.response?.body?.kind).should('eq', 'trad') cy.getTestId('route-form-hosts-input-1').clear() - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-create-form-submit').should('be.disabled') // methods and custom methods cy.getTestId('routing-rule-methods').click() cy.getTestId('get-method-toggle').check({ force: true }) - cy.getTestId('route-form-submit').should('be.enabled').click() + cy.getTestId('route-create-form-submit').should('be.enabled').click() cy.wait('@createRoute').then((res) => res.response?.body?.kind).should('eq', 'trad') cy.getTestId('get-method-toggle').uncheck({ force: true }) - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-create-form-submit').should('be.disabled') cy.getTestId('custom-method-toggle').check({ force: true }) - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-create-form-submit').should('be.disabled') cy.getTestId('route-form-custom-method-input-1').type('castom') - cy.getTestId('route-form-submit').should('be.enabled').click() + cy.getTestId('route-create-form-submit').should('be.enabled').click() cy.wait('@createRoute').then((res) => res.response?.body?.kind).should('eq', 'trad') cy.getTestId('route-form-custom-method-input-1').clear() - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-create-form-submit').should('be.disabled') // headers cy.getTestId('routing-rule-headers').click() cy.getTestId('route-form-headers-name-input-1').type(Object.keys(route.headers)[0]) - cy.getTestId('route-form-submit').should('be.enabled').click() + cy.getTestId('route-create-form-submit').should('be.enabled').click() cy.wait('@createRoute').then((res) => res.response?.body?.kind).should('eq', 'trad') cy.getTestId('route-form-headers-name-input-1').clear() cy.getTestId('route-form-headers-values-input-1').type(route.headers.Header1[0]) - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-create-form-submit').should('be.disabled') cy.getTestId('route-form-protocols').click({ force: true }) cy.get("[data-testid='select-item-tcp,tls,udp']").click({ force: true }) @@ -1236,22 +1236,22 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { // sources cy.getTestId('routing-rule-sources').click() cy.getTestId('route-form-sources-ip-input-1').type('127.0.0.1') - cy.getTestId('route-form-submit').should('be.enabled').click() + cy.getTestId('route-create-form-submit').should('be.enabled').click() cy.wait('@createRoute').then((res) => res.response?.body?.kind).should('eq', 'trad') cy.getTestId('route-form-sources-ip-input-1').clear() cy.getTestId('route-form-sources-port-input-1').type('8080') - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-create-form-submit').should('be.disabled') // destinations cy.getTestId('routing-rule-destinations').click() cy.getTestId('route-form-destinations-ip-input-1').type('127.0.0.2') - cy.getTestId('route-form-submit').should('be.enabled').click() + cy.getTestId('route-create-form-submit').should('be.enabled').click() cy.wait('@createRoute').then((res) => res.response?.body?.kind).should('eq', 'trad') cy.getTestId('route-form-destinations-ip-input-1').clear() cy.getTestId('route-form-destinations-port-input-1').type('8000') - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-create-form-submit').should('be.disabled') }) } // if !routeFlavors || routeFlavors?.traditional @@ -1277,15 +1277,15 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { } // else: we will be on expr tab by default // default button state - cy.getTestId('route-form-cancel').should('be.visible') - cy.getTestId('route-form-submit').should('be.visible') - cy.getTestId('route-form-cancel').should('be.enabled') - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-create-form-cancel').should('be.visible') + cy.getTestId('route-create-form-submit').should('be.visible') + cy.getTestId('route-create-form-cancel').should('be.enabled') + cy.getTestId('route-create-form-submit').should('be.disabled') // enables save when required fields have values // form fields - general cy.getTestId('route-form-name').should('be.visible') - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-create-form-submit').should('be.disabled') // the editor shows invalid because it is empty cy.get('.expression-editor').should('have.class', 'invalid') @@ -1297,7 +1297,7 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { // it should be no longer invalid cy.get('.expression-editor').should('not.have.class', 'invalid') // and the submit button is enabled - cy.getTestId('route-form-submit').should('be.enabled').click() + cy.getTestId('route-create-form-submit').should('be.enabled').click() cy.wait('@createRoute').then((res) => res.response?.body?.kind).should('eq', 'expr') // delete the last character @@ -1306,7 +1306,7 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { // invalid again cy.get('.expression-editor').should('have.class', 'invalid') // but the submit button is still enabled because we let the server handle uncaught errors - cy.getTestId('route-form-submit').should('be.enabled').click() + cy.getTestId('route-create-form-submit').should('be.enabled').click() cy.wait('@createRoute').then((res) => res.response?.body?.kind).should('eq', 'expr') }) } // if routeFlavors?.expressions @@ -1331,10 +1331,10 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { cy.get('.kong-ui-entities-route-form').should('be.visible') // button state - cy.getTestId('route-form-cancel').should('be.visible') - cy.getTestId('route-form-submit').should('be.visible') - cy.getTestId('route-form-cancel').should('be.enabled') - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-edit-form-cancel').should('be.visible') + cy.getTestId('route-edit-form-submit').should('be.visible') + cy.getTestId('route-edit-form-cancel').should('be.enabled') + cy.getTestId('route-edit-form-submit').should('be.disabled') if (routeFlavors?.traditional && routeFlavors?.expressions) { // trad tab should be active by default @@ -1388,10 +1388,10 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { cy.get('.kong-ui-entities-route-form').should('be.visible') // default button state - cy.getTestId('route-form-cancel').should('be.visible') - cy.getTestId('route-form-submit').should('be.visible') - cy.getTestId('route-form-cancel').should('be.enabled') - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-edit-form-cancel').should('be.visible') + cy.getTestId('route-edit-form-submit').should('be.visible') + cy.getTestId('route-edit-form-cancel').should('be.enabled') + cy.getTestId('route-edit-form-submit').should('be.disabled') if (routeFlavors?.traditional && routeFlavors?.expressions) { // trad tab should be active by default @@ -1403,7 +1403,7 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { // enables save when form has changes cy.getTestId('route-form-service-id').click({ force: true }) cy.get("[data-testid='select-item-2']").click() - cy.getTestId('route-form-submit').should('be.enabled').click() + cy.getTestId('route-edit-form-submit').should('be.enabled').click() cy.wait('@editRoute').then((res) => res.response?.body?.kind).should('eq', 'trad') cy.getTestId('remove-methods').click() @@ -1411,7 +1411,7 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { cy.getTestId('remove-paths').click() cy.getTestId('remove-headers').click() cy.getTestId('routing-rules-warning').should('be.visible') - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-edit-form-submit').should('be.disabled') }) } // if !routeFlavors || routeFlavors?.traditional @@ -1435,10 +1435,10 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { cy.get('.kong-ui-entities-route-form').should('be.visible') // button state - cy.getTestId('route-form-cancel').should('be.visible') - cy.getTestId('route-form-submit').should('be.visible') - cy.getTestId('route-form-cancel').should('be.enabled') - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-edit-form-cancel').should('be.visible') + cy.getTestId('route-edit-form-submit').should('be.visible') + cy.getTestId('route-edit-form-cancel').should('be.enabled') + cy.getTestId('route-edit-form-submit').should('be.disabled') if (routeFlavors?.traditional && routeFlavors?.expressions) { // expr tab should be active by default @@ -1481,10 +1481,10 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { cy.get('.kong-ui-entities-route-form').should('be.visible') // default button state - cy.getTestId('route-form-cancel').should('be.visible') - cy.getTestId('route-form-submit').should('be.visible') - cy.getTestId('route-form-cancel').should('be.enabled') - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-edit-form-cancel').should('be.visible') + cy.getTestId('route-edit-form-submit').should('be.visible') + cy.getTestId('route-edit-form-cancel').should('be.enabled') + cy.getTestId('route-edit-form-submit').should('be.disabled') if (routeFlavors?.traditional && routeFlavors?.expressions) { // trad tab should be active by default @@ -1494,7 +1494,7 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { // enables save when form has changes cy.getTestId('route-form-service-id').click({ force: true }) cy.get("[data-testid='select-item-2']").click() - cy.getTestId('route-form-submit').should('be.enabled').click() + cy.getTestId('route-edit-form-submit').should('be.enabled').click() cy.wait('@editRoute').then((res) => res.response?.body?.kind).should('eq', 'expr') // type a valid expression @@ -1505,7 +1505,7 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { // the editor should become invalid cy.get('.expression-editor').should('have.class', 'invalid') // but the submit button is still enabled because we let the server handle uncaught errors - cy.getTestId('route-form-submit').should('be.enabled').click() + cy.getTestId('route-edit-form-submit').should('be.enabled').click() cy.wait('@editRoute').then((res) => res.response?.body?.kind).should('eq', 'expr') }) } // if routeFlavors?.expressions @@ -1527,22 +1527,22 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { cy.get('.kong-ui-entities-route-form').should('be.visible') // default button state - cy.getTestId('route-form-cancel').should('be.visible') - cy.getTestId('route-form-submit').should('be.visible') - cy.getTestId('route-form-cancel').should('be.enabled') - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-edit-form-cancel').should('be.visible') + cy.getTestId('route-edit-form-submit').should('be.visible') + cy.getTestId('route-edit-form-cancel').should('be.enabled') + cy.getTestId('route-edit-form-submit').should('be.disabled') cy.getTestId('routing-rules-warning').should('not.exist') // enables save when form has changes cy.getTestId('route-form-service-id').click({ force: true }) cy.get("[data-testid='select-item-2']").click() - cy.getTestId('route-form-submit').should('be.enabled') + cy.getTestId('route-edit-form-submit').should('be.enabled') cy.getTestId('remove-methods').click() cy.getTestId('remove-paths').first().click() cy.getTestId('remove-paths').click() cy.getTestId('remove-headers').click() cy.getTestId('routing-rules-warning').should('be.visible') - cy.getTestId('route-form-submit').should('be.disabled') + cy.getTestId('route-edit-form-submit').should('be.disabled') }) it('should handle error state - failed to load route', () => { @@ -1575,8 +1575,8 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { cy.getTestId('form-fetch-error').should('be.visible') // buttons and form hidden - cy.getTestId('route-form-cancel').should('not.exist') - cy.getTestId('route-form-submit').should('not.exist') + cy.getTestId('route-edit-form-cancel').should('not.exist') + cy.getTestId('route-edit-form-submit').should('not.exist') cy.get('.kong-ui-entities-route-form form').should('not.exist') }) @@ -1657,8 +1657,8 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { cy.get('.form-section-info sticky').should('not.exist') // default buttons should be replaced with slotted content - cy.getTestId('route-form-cancel').should('not.exist') - cy.getTestId('route-form-submit').should('not.exist') + cy.getTestId('route-create-form-cancel').should('not.exist') + cy.getTestId('route-create-form-submit').should('not.exist') cy.getTestId('slotted-cancel-button').should('be.visible') cy.getTestId('slotted-submit-button').should('be.visible') }) diff --git a/packages/entities/entities-shared/src/components/entity-base-form/EntityBaseForm.cy.ts b/packages/entities/entities-shared/src/components/entity-base-form/EntityBaseForm.cy.ts index 9370a66791..e7196a0f2c 100644 --- a/packages/entities/entities-shared/src/components/entity-base-form/EntityBaseForm.cy.ts +++ b/packages/entities/entities-shared/src/components/entity-base-form/EntityBaseForm.cy.ts @@ -28,11 +28,11 @@ describe('', () => { }, }) - cy.getTestId(`${entityType}-form-cancel`).should('be.visible') - cy.getTestId(`${entityType}-form-submit`).should('be.visible') + cy.getTestId(`${entityType}-create-form-cancel`).should('be.visible') + cy.getTestId(`${entityType}-create-form-submit`).should('be.visible') - cy.getTestId(`${entityType}-form-cancel`).should('be.enabled') - cy.getTestId(`${entityType}-form-submit`).should('be.disabled') + cy.getTestId(`${entityType}-create-form-cancel`).should('be.enabled') + cy.getTestId(`${entityType}-create-form-submit`).should('be.disabled') }) it('disables save and cancel when isReadonly is true', () => { @@ -46,11 +46,11 @@ describe('', () => { }, }) - cy.getTestId(`${entityType}-form-cancel`).should('be.visible') - cy.getTestId(`${entityType}-form-submit`).should('be.visible') + cy.getTestId(`${entityType}-create-form-cancel`).should('be.visible') + cy.getTestId(`${entityType}-create-form-submit`).should('be.visible') - cy.getTestId(`${entityType}-form-cancel`).should('be.disabled') - cy.getTestId(`${entityType}-form-submit`).should('be.disabled') + cy.getTestId(`${entityType}-create-form-cancel`).should('be.disabled') + cy.getTestId(`${entityType}-create-form-submit`).should('be.disabled') }) it('displays View Configuration and Slideout when FF is enabled', () => { @@ -111,11 +111,11 @@ describe('', () => { }) cy.getTestId('form-fetch-error').should('not.exist') - cy.getTestId(`${entityType}-form-cancel`).should('be.visible') - cy.getTestId(`${entityType}-form-submit`).should('be.visible') + cy.getTestId(`${entityType}-edit-form-cancel`).should('be.visible') + cy.getTestId(`${entityType}-edit-form-submit`).should('be.visible') - cy.getTestId(`${entityType}-form-cancel`).should('be.enabled') - cy.getTestId(`${entityType}-form-submit`).should('be.enabled') + cy.getTestId(`${entityType}-edit-form-cancel`).should('be.enabled') + cy.getTestId(`${entityType}-edit-form-submit`).should('be.enabled') }) it('handles edit flow when load is unsuccessful', () => { @@ -142,8 +142,8 @@ describe('', () => { }) cy.getTestId('form-fetch-error').should('be.visible') - cy.getTestId(`${entityType}-form-cancel`).should('not.exist') - cy.getTestId(`${entityType}-form-submit`).should('not.exist') + cy.getTestId(`${entityType}-edit-form-cancel`).should('not.exist') + cy.getTestId(`${entityType}-edit-form-submit`).should('not.exist') }) it('should show slot content', () => { diff --git a/packages/entities/entities-shared/src/components/entity-base-form/EntityBaseForm.vue b/packages/entities/entities-shared/src/components/entity-base-form/EntityBaseForm.vue index c95c6ef8a2..11687aed06 100644 --- a/packages/entities/entities-shared/src/components/entity-base-form/EntityBaseForm.vue +++ b/packages/entities/entities-shared/src/components/entity-base-form/EntityBaseForm.vue @@ -48,14 +48,14 @@ {{ t('baseForm.actions.viewConfiguration') }} @@ -63,7 +63,7 @@ @@ -225,6 +225,7 @@ const { getMessageFromError } = composables.useErrors() const { axiosInstance } = composables.useAxios(props.config?.axiosRequestConfig) const isLoading = ref(false) +const isEditing = computed(() => !!props.editId) const fetchDetailsError = ref(false) const fetchErrorMessage = ref('') const disableSave = computed((): boolean => props.canSubmit === false || props.isReadonly) diff --git a/packages/entities/entities-snis/src/components/SniForm.cy.ts b/packages/entities/entities-snis/src/components/SniForm.cy.ts index 23eb4e902a..c7aece955c 100644 --- a/packages/entities/entities-snis/src/components/SniForm.cy.ts +++ b/packages/entities/entities-snis/src/components/SniForm.cy.ts @@ -91,10 +91,10 @@ describe('', () => { cy.get('.kong-ui-entities-snis-form').should('be.visible') cy.get('.kong-ui-entities-snis-form form').should('be.visible') // button state - cy.getTestId('sni-form-cancel').should('be.visible') - cy.getTestId('sni-form-submit').should('be.visible') - cy.getTestId('sni-form-cancel').should('be.enabled') - cy.getTestId('sni-form-submit').should('be.disabled') + cy.getTestId('sni-create-form-cancel').should('be.visible') + cy.getTestId('sni-create-form-submit').should('be.visible') + cy.getTestId('sni-create-form-cancel').should('be.enabled') + cy.getTestId('sni-create-form-submit').should('be.disabled') // form fields cy.getTestId('sni-form-name').should('be.visible') cy.getTestId('sni-form-tags').should('be.visible') @@ -116,18 +116,18 @@ describe('', () => { cy.wait('@getCertificates') cy.get('.kong-ui-entities-snis-form').should('be.visible') // default button state - cy.getTestId('sni-form-cancel').should('be.visible') - cy.getTestId('sni-form-submit').should('be.visible') - cy.getTestId('sni-form-cancel').should('be.enabled') - cy.getTestId('sni-form-submit').should('be.disabled') + cy.getTestId('sni-create-form-cancel').should('be.visible') + cy.getTestId('sni-create-form-submit').should('be.visible') + cy.getTestId('sni-create-form-cancel').should('be.enabled') + cy.getTestId('sni-create-form-submit').should('be.disabled') // enables save when required fields have values cy.getTestId('sni-form-name').type('tk-meowstersmith') cy.getTestId('sni-form-certificate-id').click() cy.get(`[data-testid="select-item-${certificates.data[0].id}"] button`).click() - cy.getTestId('sni-form-submit').should('be.enabled') + cy.getTestId('sni-create-form-submit').should('be.enabled') // disables save when required field is cleared cy.getTestId('sni-form-name').clear() - cy.getTestId('sni-form-submit').should('be.disabled') + cy.getTestId('sni-create-form-submit').should('be.disabled') }) it('should allow exact match filtering of certs', () => { @@ -205,10 +205,10 @@ describe('', () => { cy.wait('@getSni') cy.get('.kong-ui-entities-snis-form').should('be.visible') // button state - cy.getTestId('sni-form-cancel').should('be.visible') - cy.getTestId('sni-form-submit').should('be.visible') - cy.getTestId('sni-form-cancel').should('be.enabled') - cy.getTestId('sni-form-submit').should('be.disabled') + cy.getTestId('sni-edit-form-cancel').should('be.visible') + cy.getTestId('sni-edit-form-submit').should('be.visible') + cy.getTestId('sni-edit-form-cancel').should('be.enabled') + cy.getTestId('sni-edit-form-submit').should('be.disabled') // form fields cy.getTestId('sni-form-name').should('have.value', sni1.name) sni1.tags.forEach((tag: string) => { @@ -234,17 +234,17 @@ describe('', () => { cy.wait('@getCertificates') cy.get('.kong-ui-entities-snis-form').should('be.visible') // default button state - cy.getTestId('sni-form-cancel').should('be.visible') - cy.getTestId('sni-form-submit').should('be.visible') - cy.getTestId('sni-form-cancel').should('be.enabled') - cy.getTestId('sni-form-submit').should('be.disabled') + cy.getTestId('sni-edit-form-cancel').should('be.visible') + cy.getTestId('sni-edit-form-submit').should('be.visible') + cy.getTestId('sni-edit-form-cancel').should('be.enabled') + cy.getTestId('sni-edit-form-submit').should('be.disabled') // enables save when form has changes cy.getTestId('sni-form-name').type('-edited') - cy.getTestId('sni-form-submit').should('be.enabled') + cy.getTestId('sni-edit-form-submit').should('be.enabled') // disables save when form changes are undone cy.getTestId('sni-form-name').clear() cy.getTestId('sni-form-name').type(sni1.name) - cy.getTestId('sni-form-submit').should('be.disabled') + cy.getTestId('sni-edit-form-submit').should('be.disabled') }) it('should handle error state - failed to load SNI', () => { @@ -274,8 +274,8 @@ describe('', () => { // error state is displayed cy.getTestId('form-fetch-error').should('be.visible') // buttons and form hidden - cy.getTestId('sni-form-cancel').should('not.exist') - cy.getTestId('sni-form-submit').should('not.exist') + cy.getTestId('sni-edit-form-cancel').should('not.exist') + cy.getTestId('sni-edit-form-submit').should('not.exist') cy.get('.kong-ui-entities-snis-form form').should('not.exist') }) @@ -417,10 +417,10 @@ describe('', () => { cy.get('.kong-ui-entities-snis-form').should('be.visible') cy.get('.kong-ui-entities-snis-form form').should('be.visible') // button state - cy.getTestId('sni-form-cancel').should('be.visible') - cy.getTestId('sni-form-submit').should('be.visible') - cy.getTestId('sni-form-cancel').should('be.enabled') - cy.getTestId('sni-form-submit').should('be.disabled') + cy.getTestId('sni-create-form-cancel').should('be.visible') + cy.getTestId('sni-create-form-submit').should('be.visible') + cy.getTestId('sni-create-form-cancel').should('be.enabled') + cy.getTestId('sni-create-form-submit').should('be.disabled') // form fields cy.getTestId('sni-form-name').should('be.visible') cy.getTestId('sni-form-tags').should('be.visible') @@ -442,18 +442,18 @@ describe('', () => { cy.wait('@getCertificates') cy.get('.kong-ui-entities-snis-form').should('be.visible') // default button state - cy.getTestId('sni-form-cancel').should('be.visible') - cy.getTestId('sni-form-submit').should('be.visible') - cy.getTestId('sni-form-cancel').should('be.enabled') - cy.getTestId('sni-form-submit').should('be.disabled') + cy.getTestId('sni-create-form-cancel').should('be.visible') + cy.getTestId('sni-create-form-submit').should('be.visible') + cy.getTestId('sni-create-form-cancel').should('be.enabled') + cy.getTestId('sni-create-form-submit').should('be.disabled') // enables save when required fields have values cy.getTestId('sni-form-name').type('tk-meowstersmith') cy.getTestId('sni-form-certificate-id').click() cy.get(`[data-testid="select-item-${certificates.data[0].id}"] button`).click() - cy.getTestId('sni-form-submit').should('be.enabled') + cy.getTestId('sni-create-form-submit').should('be.enabled') // disables save when required field is cleared cy.getTestId('sni-form-name').clear() - cy.getTestId('sni-form-submit').should('be.disabled') + cy.getTestId('sni-create-form-submit').should('be.disabled') }) it('should allow exact match filtering of certs', () => { @@ -530,10 +530,10 @@ describe('', () => { cy.wait('@getSni') cy.get('.kong-ui-entities-snis-form').should('be.visible') // button state - cy.getTestId('sni-form-cancel').should('be.visible') - cy.getTestId('sni-form-submit').should('be.visible') - cy.getTestId('sni-form-cancel').should('be.enabled') - cy.getTestId('sni-form-submit').should('be.disabled') + cy.getTestId('sni-edit-form-cancel').should('be.visible') + cy.getTestId('sni-edit-form-submit').should('be.visible') + cy.getTestId('sni-edit-form-cancel').should('be.enabled') + cy.getTestId('sni-edit-form-submit').should('be.disabled') // form fields cy.getTestId('sni-form-name').should('have.value', sni1.name) sni1.tags.forEach((tag: string) => { @@ -559,17 +559,17 @@ describe('', () => { cy.wait('@getCertificates') cy.get('.kong-ui-entities-snis-form').should('be.visible') // default button state - cy.getTestId('sni-form-cancel').should('be.visible') - cy.getTestId('sni-form-submit').should('be.visible') - cy.getTestId('sni-form-cancel').should('be.enabled') - cy.getTestId('sni-form-submit').should('be.disabled') + cy.getTestId('sni-edit-form-cancel').should('be.visible') + cy.getTestId('sni-edit-form-submit').should('be.visible') + cy.getTestId('sni-edit-form-cancel').should('be.enabled') + cy.getTestId('sni-edit-form-submit').should('be.disabled') // enables save when form has changes cy.getTestId('sni-form-name').type('-edited') - cy.getTestId('sni-form-submit').should('be.enabled') + cy.getTestId('sni-edit-form-submit').should('be.enabled') // disables save when form changes are undone cy.getTestId('sni-form-name').clear() cy.getTestId('sni-form-name').type(sni1.name) - cy.getTestId('sni-form-submit').should('be.disabled') + cy.getTestId('sni-edit-form-submit').should('be.disabled') }) it('should handle error state - failed to load SNI', () => { @@ -599,8 +599,8 @@ describe('', () => { // error state is displayed cy.getTestId('form-fetch-error').should('be.visible') // buttons and form hidden - cy.getTestId('sni-form-cancel').should('not.exist') - cy.getTestId('sni-form-submit').should('not.exist') + cy.getTestId('sni-edit-form-cancel').should('not.exist') + cy.getTestId('sni-edit-form-submit').should('not.exist') cy.get('.kong-ui-entities-snis-form form').should('not.exist') }) diff --git a/packages/entities/entities-upstreams-targets/src/components/UpstreamsForm.cy.ts b/packages/entities/entities-upstreams-targets/src/components/UpstreamsForm.cy.ts index f14a554978..55dce9c1b6 100644 --- a/packages/entities/entities-upstreams-targets/src/components/UpstreamsForm.cy.ts +++ b/packages/entities/entities-upstreams-targets/src/components/UpstreamsForm.cy.ts @@ -102,10 +102,10 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => cy.get('.kong-ui-entities-upstreams-active-healthcheck').should('not.exist') cy.get('.kong-ui-entities-upstreams-passive-healthcheck').should('not.exist') - cy.getTestId('upstream-form-cancel').should('be.visible') - cy.getTestId('upstream-form-cancel').should('be.enabled') - cy.getTestId('upstream-form-submit').should('be.visible') - cy.getTestId('upstream-form-submit').should('be.disabled') + cy.getTestId('upstream-create-form-cancel').should('be.visible') + cy.getTestId('upstream-create-form-cancel').should('be.enabled') + cy.getTestId('upstream-create-form-submit').should('be.visible') + cy.getTestId('upstream-create-form-submit').should('be.disabled') }) it('Should show Active and Passive healthchecks when switchers are turned on', () => { @@ -139,13 +139,13 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => cy.wait(['@fetchServices', '@fetchCertificates']) - cy.getTestId('upstream-form-submit').should('be.visible') - cy.getTestId('upstream-form-submit').should('be.disabled') + cy.getTestId('upstream-create-form-submit').should('be.visible') + cy.getTestId('upstream-create-form-submit').should('be.disabled') cy.get('.name-select').click() cy.getTestId('select-item-2').first().click() - cy.getTestId('upstream-form-submit').should('be.enabled') + cy.getTestId('upstream-create-form-submit').should('be.enabled') }) it('loading event should be emitted when EntityBaseForm emits loading event', () => { @@ -364,7 +364,7 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => cy.getTestId('passive-healthcheck-tcp-failures').should('have.value', '5') cy.getTestId('passive-healthcheck-http-failures').should('have.value', '5') - cy.getTestId('upstream-form-submit').click() + cy.getTestId('upstream-create-form-submit').click() cy.wait('@createUpstream').then((interception) => { const { body: { healthchecks: { active, passive } } } = interception.request @@ -403,7 +403,7 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => cy.getTestId('active-health-switch').uncheck({ force: true }) cy.getTestId('passive-health-switch').uncheck({ force: true }) - cy.getTestId('upstream-form-submit').click() + cy.getTestId('upstream-edit-form-submit').click() cy.wait('@updateUpstream').then((interception) => { const { body: { healthchecks } } = interception.request @@ -505,10 +505,10 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => cy.get('.kong-ui-entities-upstreams-active-healthcheck').should('not.exist') cy.get('.kong-ui-entities-upstreams-passive-healthcheck').should('not.exist') - cy.getTestId('upstream-form-cancel').should('be.visible') - cy.getTestId('upstream-form-cancel').should('be.enabled') - cy.getTestId('upstream-form-submit').should('be.visible') - cy.getTestId('upstream-form-submit').should('be.disabled') + cy.getTestId('upstream-create-form-cancel').should('be.visible') + cy.getTestId('upstream-create-form-cancel').should('be.enabled') + cy.getTestId('upstream-create-form-submit').should('be.visible') + cy.getTestId('upstream-create-form-submit').should('be.disabled') }) it('Should show Active and Passive healthchecks when switchers are turned on', () => { @@ -545,13 +545,13 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => cy.wait(['@fetchServices', '@fetchCertificates']) - cy.getTestId('upstream-form-submit').should('be.visible') - cy.getTestId('upstream-form-submit').should('be.disabled') + cy.getTestId('upstream-create-form-submit').should('be.visible') + cy.getTestId('upstream-create-form-submit').should('be.disabled') cy.get('.name-select').click() cy.getTestId('select-item-2').first().click() - cy.getTestId('upstream-form-submit').should('be.enabled') + cy.getTestId('upstream-create-form-submit').should('be.enabled') }) it('loading event should be emitted when EntityBaseForm emits loading event', () => { @@ -832,7 +832,7 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => cy.getTestId('passive-healthcheck-tcp-failures').should('have.value', '5') cy.getTestId('passive-healthcheck-http-failures').should('have.value', '5') - cy.getTestId('upstream-form-submit').click() + cy.getTestId('upstream-create-form-submit').click() cy.wait('@createUpstream').then((interception) => { const { body: { healthchecks: { active, passive } } } = interception.request @@ -871,7 +871,7 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => cy.getTestId('active-health-switch').uncheck({ force: true }) cy.getTestId('passive-health-switch').uncheck({ force: true }) - cy.getTestId('upstream-form-submit').click() + cy.getTestId('upstream-edit-form-submit').click() cy.wait('@updateUpstream').then((interception) => { const { body: { healthchecks } } = interception.request diff --git a/packages/entities/entities-vaults/src/components/SecretForm.cy.ts b/packages/entities/entities-vaults/src/components/SecretForm.cy.ts index 58628503f3..dcc5f1df54 100644 --- a/packages/entities/entities-vaults/src/components/SecretForm.cy.ts +++ b/packages/entities/entities-vaults/src/components/SecretForm.cy.ts @@ -42,10 +42,10 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { cy.get('.kong-ui-entities-secret-form').should('be.visible') cy.get('.kong-ui-entities-secret-form form').should('be.visible') // button state - cy.getTestId('other-form-cancel').should('be.visible') - cy.getTestId('other-form-submit').should('be.visible') - cy.getTestId('other-form-cancel').should('be.enabled') - cy.getTestId('other-form-submit').should('be.disabled') + cy.getTestId('other-create-form-cancel').should('be.visible') + cy.getTestId('other-create-form-submit').should('be.visible') + cy.getTestId('other-create-form-cancel').should('be.enabled') + cy.getTestId('other-create-form-submit').should('be.disabled') // form fields cy.getTestId('secret-form-key').should('be.visible') cy.getTestId('secret-form-value').should('be.visible') @@ -61,18 +61,18 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { cy.get('.kong-ui-entities-secret-form').should('be.visible') // default button state - cy.getTestId('other-form-cancel').should('be.visible') - cy.getTestId('other-form-submit').should('be.visible') - cy.getTestId('other-form-cancel').should('be.enabled') - cy.getTestId('other-form-submit').should('be.disabled') + cy.getTestId('other-create-form-cancel').should('be.visible') + cy.getTestId('other-create-form-submit').should('be.visible') + cy.getTestId('other-create-form-cancel').should('be.enabled') + cy.getTestId('other-create-form-submit').should('be.disabled') // enables save when required fields have values cy.getTestId('secret-form-key').type('bicycle-kick') cy.getTestId('secret-form-value').clear() cy.getTestId('secret-form-value').type('101') - cy.getTestId('other-form-submit').should('be.enabled') + cy.getTestId('other-create-form-submit').should('be.enabled') // disables save when required field is cleared cy.getTestId('secret-form-key').clear() - cy.getTestId('other-form-submit').should('be.disabled') + cy.getTestId('other-create-form-submit').should('be.disabled') }) it('should show edit form', () => { @@ -89,10 +89,10 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { cy.wait('@getSecret') cy.get('.kong-ui-entities-secret-form').should('be.visible') // default button state - cy.getTestId('other-form-cancel').should('be.visible') - cy.getTestId('other-form-submit').should('be.visible') - cy.getTestId('other-form-cancel').should('be.enabled') - cy.getTestId('other-form-submit').should('be.disabled') + cy.getTestId('other-edit-form-cancel').should('be.visible') + cy.getTestId('other-edit-form-submit').should('be.visible') + cy.getTestId('other-edit-form-cancel').should('be.enabled') + cy.getTestId('other-edit-form-submit').should('be.disabled') // form fields cy.getTestId('secret-form-key').should('be.disabled') cy.getTestId('secret-form-key').should('have.value', secret.key) @@ -113,16 +113,16 @@ describe('', { viewportHeight: 700, viewportWidth: 700 }, () => { cy.wait('@getSecret') cy.get('.kong-ui-entities-secret-form').should('be.visible') // default button state - cy.getTestId('other-form-cancel').should('be.visible') - cy.getTestId('other-form-submit').should('be.visible') - cy.getTestId('other-form-cancel').should('be.enabled') - cy.getTestId('other-form-submit').should('be.disabled') + cy.getTestId('other-edit-form-cancel').should('be.visible') + cy.getTestId('other-edit-form-submit').should('be.visible') + cy.getTestId('other-edit-form-cancel').should('be.enabled') + cy.getTestId('other-edit-form-submit').should('be.disabled') // enables save when form has changes cy.getTestId('secret-form-value').type('ubiquitous') - cy.getTestId('other-form-submit').should('be.enabled') + cy.getTestId('other-edit-form-submit').should('be.enabled') // disables save when form changes are undone cy.getTestId('secret-form-value').clear() - cy.getTestId('other-form-submit').should('be.disabled') + cy.getTestId('other-edit-form-submit').should('be.disabled') }) it('should handle error state - failed to load secret', () => { diff --git a/packages/entities/entities-vaults/src/components/VaultForm.cy.ts b/packages/entities/entities-vaults/src/components/VaultForm.cy.ts index 75eaad466d..d49e5261b6 100644 --- a/packages/entities/entities-vaults/src/components/VaultForm.cy.ts +++ b/packages/entities/entities-vaults/src/components/VaultForm.cy.ts @@ -85,10 +85,10 @@ describe('', () => { cy.get('.kong-ui-entities-vault-form').should('be.visible') cy.get('.kong-ui-entities-vault-form form').should('be.visible') // button state - cy.getTestId('vault-form-cancel').should('be.visible') - cy.getTestId('vault-form-submit').should('be.visible') - cy.getTestId('vault-form-cancel').should('be.enabled') - cy.getTestId('vault-form-submit').should('be.disabled') + cy.getTestId('vault-create-form-cancel').should('be.visible') + cy.getTestId('vault-create-form-submit').should('be.visible') + cy.getTestId('vault-create-form-cancel').should('be.enabled') + cy.getTestId('vault-create-form-submit').should('be.disabled') // form fields - general cy.getTestId('vault-form-prefix').should('be.visible') @@ -147,10 +147,10 @@ describe('', () => { cy.get('.kong-ui-entities-vault-form').should('be.visible') cy.get('.kong-ui-entities-vault-form form').should('be.visible') // button state - cy.getTestId('vault-form-cancel').should('be.visible') - cy.getTestId('vault-form-submit').should('be.visible') - cy.getTestId('vault-form-cancel').should('be.enabled') - cy.getTestId('vault-form-submit').should('be.disabled') + cy.getTestId('vault-create-form-cancel').should('be.visible') + cy.getTestId('vault-create-form-submit').should('be.visible') + cy.getTestId('vault-create-form-cancel').should('be.enabled') + cy.getTestId('vault-create-form-submit').should('be.disabled') // form fields - general cy.getTestId('vault-form-prefix').should('be.visible') @@ -208,38 +208,38 @@ describe('', () => { cy.get('.kong-ui-entities-vault-form').should('be.visible') // default button state - cy.getTestId('vault-form-cancel').should('be.visible') - cy.getTestId('vault-form-submit').should('be.visible') - cy.getTestId('vault-form-cancel').should('be.enabled') - cy.getTestId('vault-form-submit').should('be.disabled') + cy.getTestId('vault-create-form-cancel').should('be.visible') + cy.getTestId('vault-create-form-submit').should('be.visible') + cy.getTestId('vault-create-form-cancel').should('be.enabled') + cy.getTestId('vault-create-form-submit').should('be.disabled') // enables save when required fields have values // form fields - general cy.getTestId('vault-form-prefix').type(vault.prefix) // form fields - kong cy.getTestId('vault-form-config-kong-prefix').type(vault.config.prefix) - cy.getTestId('vault-form-submit').should('be.enabled') + cy.getTestId('vault-create-form-submit').should('be.enabled') // disables save when required field is cleared cy.getTestId('vault-form-config-kong-prefix').clear() - cy.getTestId('vault-form-submit').should('be.disabled') + cy.getTestId('vault-create-form-submit').should('be.disabled') // form fields - aws cy.getTestId('provider-select').click({ force: true }) cy.getTestId('vault-form-provider-aws').click({ force: true }) - cy.getTestId('vault-form-submit').should('be.disabled') + cy.getTestId('vault-create-form-submit').should('be.disabled') cy.getTestId('vault-form-config-aws-region').click({ force: true }) cy.get('.vault-form-config-fields-container .select-item:eq(0) button').click({ force: true }) - cy.getTestId('vault-form-submit').should('be.enabled') + cy.getTestId('vault-create-form-submit').should('be.enabled') // form fields - gcp cy.getTestId('provider-select').click({ force: true }) cy.getTestId('vault-form-provider-gcp').click({ force: true }) - cy.getTestId('vault-form-submit').should('be.disabled') + cy.getTestId('vault-create-form-submit').should('be.disabled') cy.getTestId('vault-form-config-gcp-project-id').type('test123') - cy.getTestId('vault-form-submit').should('be.enabled') + cy.getTestId('vault-create-form-submit').should('be.enabled') // disables save when required field is cleared cy.getTestId('vault-form-config-gcp-project-id').clear() - cy.getTestId('vault-form-submit').should('be.disabled') + cy.getTestId('vault-create-form-submit').should('be.disabled') // form fields - hcv cy.getTestId('provider-select').click({ force: true }) @@ -251,17 +251,17 @@ describe('', () => { cy.getTestId('vault-form-config-hcv-kv').click({ force: true }) cy.get('[data-testid="select-item-v1"] button').click() cy.getTestId('vault-form-config-hcv-token').type('token') - cy.getTestId('vault-form-submit').should('be.enabled') + cy.getTestId('vault-create-form-submit').should('be.enabled') cy.getTestId('vault-form-config-hcv-auth_method').click({ force: true }) cy.get('[data-testid="select-item-kubernetes"] button').click() - cy.getTestId('vault-form-submit').should('be.disabled') + cy.getTestId('vault-create-form-submit').should('be.disabled') cy.getTestId('vault-form-config-hcv-kube_role').type('role') cy.getTestId('vault-form-config-hcv-kube_api_token_file').type('file.txt') - cy.getTestId('vault-form-submit').should('be.enabled') + cy.getTestId('vault-create-form-submit').should('be.enabled') // disables save when required field is cleared - general cy.getTestId('vault-form-prefix').clear() - cy.getTestId('vault-form-submit').should('be.disabled') + cy.getTestId('vault-create-form-submit').should('be.disabled') }) it('should show edit form', () => { @@ -277,10 +277,10 @@ describe('', () => { cy.wait('@getVault') cy.get('.kong-ui-entities-vault-form').should('be.visible') // button state - cy.getTestId('vault-form-cancel').should('be.visible') - cy.getTestId('vault-form-submit').should('be.visible') - cy.getTestId('vault-form-cancel').should('be.enabled') - cy.getTestId('vault-form-submit').should('be.disabled') + cy.getTestId('vault-edit-form-cancel').should('be.visible') + cy.getTestId('vault-edit-form-submit').should('be.visible') + cy.getTestId('vault-edit-form-cancel').should('be.enabled') + cy.getTestId('vault-edit-form-submit').should('be.disabled') // form fields cy.getTestId('vault-form-prefix').should('have.value', vault.prefix) @@ -302,10 +302,10 @@ describe('', () => { cy.wait('@getVault') cy.get('.kong-ui-entities-vault-form').should('be.visible') // button state - cy.getTestId('vault-form-cancel').should('be.visible') - cy.getTestId('vault-form-submit').should('be.visible') - cy.getTestId('vault-form-cancel').should('be.enabled') - cy.getTestId('vault-form-submit').should('be.disabled') + cy.getTestId('vault-edit-form-cancel').should('be.visible') + cy.getTestId('vault-edit-form-submit').should('be.visible') + cy.getTestId('vault-edit-form-cancel').should('be.enabled') + cy.getTestId('vault-edit-form-submit').should('be.disabled') // form fields cy.getTestId('vault-form-prefix').should('have.value', vault.prefix) @@ -332,16 +332,16 @@ describe('', () => { cy.wait('@getVault') cy.get('.kong-ui-entities-vault-form').should('be.visible') // default button state - cy.getTestId('vault-form-cancel').should('be.visible') - cy.getTestId('vault-form-submit').should('be.visible') - cy.getTestId('vault-form-cancel').should('be.enabled') - cy.getTestId('vault-form-submit').should('be.disabled') + cy.getTestId('vault-edit-form-cancel').should('be.visible') + cy.getTestId('vault-edit-form-submit').should('be.visible') + cy.getTestId('vault-edit-form-cancel').should('be.enabled') + cy.getTestId('vault-edit-form-submit').should('be.disabled') // enables save when form has changes cy.getTestId('vault-form-config-kong-prefix').type('edited') - cy.getTestId('vault-form-submit').should('be.enabled') + cy.getTestId('vault-edit-form-submit').should('be.enabled') // disables save when required field is cleared cy.getTestId('vault-form-prefix').clear() - cy.getTestId('vault-form-submit').should('be.disabled') + cy.getTestId('vault-edit-form-submit').should('be.disabled') }) it('should disable vault provider field - edit', () => { @@ -383,8 +383,8 @@ describe('', () => { // error state is displayed cy.getTestId('form-fetch-error').should('be.visible') // buttons and form hidden - cy.getTestId('vault-form-cancel').should('not.exist') - cy.getTestId('vault-form-submit').should('not.exist') + cy.getTestId('vault-edit-form-cancel').should('not.exist') + cy.getTestId('vault-edit-form-submit').should('not.exist') cy.get('.kong-ui-entities-vault-form form').should('not.exist') }) @@ -474,10 +474,10 @@ describe('', () => { cy.get('.kong-ui-entities-vault-form').should('be.visible') cy.get('.kong-ui-entities-vault-form form').should('be.visible') // button state - cy.getTestId('vault-form-cancel').should('be.visible') - cy.getTestId('vault-form-submit').should('be.visible') - cy.getTestId('vault-form-cancel').should('be.enabled') - cy.getTestId('vault-form-submit').should('be.disabled') + cy.getTestId('vault-create-form-cancel').should('be.visible') + cy.getTestId('vault-create-form-submit').should('be.visible') + cy.getTestId('vault-create-form-cancel').should('be.enabled') + cy.getTestId('vault-create-form-submit').should('be.disabled') // form fields - general cy.getTestId('vault-form-prefix').should('be.visible') @@ -543,10 +543,10 @@ describe('', () => { cy.get('.kong-ui-entities-vault-form').should('be.visible') cy.get('.kong-ui-entities-vault-form form').should('be.visible') // button state - cy.getTestId('vault-form-cancel').should('be.visible') - cy.getTestId('vault-form-submit').should('be.visible') - cy.getTestId('vault-form-cancel').should('be.enabled') - cy.getTestId('vault-form-submit').should('be.disabled') + cy.getTestId('vault-create-form-cancel').should('be.visible') + cy.getTestId('vault-create-form-submit').should('be.visible') + cy.getTestId('vault-create-form-cancel').should('be.enabled') + cy.getTestId('vault-create-form-submit').should('be.disabled') // form fields - general cy.getTestId('vault-form-prefix').should('be.visible') @@ -610,30 +610,30 @@ describe('', () => { cy.get('.kong-ui-entities-vault-form').should('be.visible') // default button state - cy.getTestId('vault-form-cancel').should('be.visible') - cy.getTestId('vault-form-submit').should('be.visible') - cy.getTestId('vault-form-cancel').should('be.enabled') - cy.getTestId('vault-form-submit').should('be.disabled') + cy.getTestId('vault-create-form-cancel').should('be.visible') + cy.getTestId('vault-create-form-submit').should('be.visible') + cy.getTestId('vault-create-form-cancel').should('be.enabled') + cy.getTestId('vault-create-form-submit').should('be.disabled') // enables save when required fields have values // form fields - general cy.getTestId('vault-form-prefix').type(vault.prefix) // form fields - konnect - cy.getTestId('vault-form-submit').should('be.enabled') + cy.getTestId('vault-create-form-submit').should('be.enabled') // form fields - env cy.getTestId('provider-select').click({ force: true }) cy.getTestId('vault-form-provider-env').click({ force: true }) cy.getTestId('vault-form-config-kong-prefix').type(vault.config.prefix) - cy.getTestId('vault-form-submit').should('be.enabled') + cy.getTestId('vault-create-form-submit').should('be.enabled') // disables save when required field is cleared cy.getTestId('vault-form-config-kong-prefix').clear() - cy.getTestId('vault-form-submit').should('be.disabled') + cy.getTestId('vault-create-form-submit').should('be.disabled') // form fields - aws cy.getTestId('provider-select').click({ force: true }) cy.getTestId('vault-form-provider-aws').click({ force: true }) - cy.getTestId('vault-form-submit').should('be.disabled') + cy.getTestId('vault-create-form-submit').should('be.disabled') // advanced fields form cy.getTestId('collapse-trigger-content').click() @@ -644,12 +644,12 @@ describe('', () => { cy.getTestId('vault-form-config-aws-region').click({ force: true }) cy.get('.vault-form-config-fields-container .select-item:eq(0) button').click({ force: true }) - cy.getTestId('vault-form-submit').should('be.enabled') + cy.getTestId('vault-create-form-submit').should('be.enabled') // form fields - gcp cy.getTestId('provider-select').click({ force: true }) cy.getTestId('vault-form-provider-gcp').click({ force: true }) - cy.getTestId('vault-form-submit').should('be.disabled') + cy.getTestId('vault-create-form-submit').should('be.disabled') // advanced fields form cy.getTestId('vault-ttl-input').type('123') @@ -657,10 +657,10 @@ describe('', () => { cy.getTestId('vault-resurrect-ttl-input').type('789') cy.getTestId('vault-form-config-gcp-project-id').type('test123') - cy.getTestId('vault-form-submit').should('be.enabled') + cy.getTestId('vault-create-form-submit').should('be.enabled') // disables save when required field is cleared cy.getTestId('vault-form-config-gcp-project-id').clear() - cy.getTestId('vault-form-submit').should('be.disabled') + cy.getTestId('vault-create-form-submit').should('be.disabled') // form fields - hcv cy.getTestId('provider-select').click({ force: true }) @@ -678,17 +678,17 @@ describe('', () => { cy.getTestId('vault-form-config-hcv-kv').click({ force: true }) cy.get('[data-testid="select-item-v1"] button').click() cy.getTestId('vault-form-config-hcv-token').type('token') - cy.getTestId('vault-form-submit').should('be.enabled') + cy.getTestId('vault-create-form-submit').should('be.enabled') cy.getTestId('vault-form-config-hcv-auth_method').click({ force: true }) cy.get('[data-testid="select-item-kubernetes"] button').click() - cy.getTestId('vault-form-submit').should('be.disabled') + cy.getTestId('vault-create-form-submit').should('be.disabled') cy.getTestId('vault-form-config-hcv-kube_role').type('role') cy.getTestId('vault-form-config-hcv-kube_api_token_file').type('file.txt') - cy.getTestId('vault-form-submit').should('be.enabled') + cy.getTestId('vault-create-form-submit').should('be.enabled') // disables save when required field is cleared - general cy.getTestId('vault-form-prefix').clear() - cy.getTestId('vault-form-submit').should('be.disabled') + cy.getTestId('vault-create-form-submit').should('be.disabled') }) it('should show edit form', () => { @@ -704,10 +704,10 @@ describe('', () => { cy.wait('@getVault') cy.get('.kong-ui-entities-vault-form').should('be.visible') // button state - cy.getTestId('vault-form-cancel').should('be.visible') - cy.getTestId('vault-form-submit').should('be.visible') - cy.getTestId('vault-form-cancel').should('be.enabled') - cy.getTestId('vault-form-submit').should('be.disabled') + cy.getTestId('vault-edit-form-cancel').should('be.visible') + cy.getTestId('vault-edit-form-submit').should('be.visible') + cy.getTestId('vault-edit-form-cancel').should('be.enabled') + cy.getTestId('vault-edit-form-submit').should('be.disabled') // form fields cy.getTestId('vault-form-prefix').should('have.value', vault.prefix) cy.getTestId('vault-form-description').should('have.value', vault.description) @@ -733,10 +733,10 @@ describe('', () => { cy.wait('@getVault') cy.get('.kong-ui-entities-vault-form').should('be.visible') // button state - cy.getTestId('vault-form-cancel').should('be.visible') - cy.getTestId('vault-form-submit').should('be.visible') - cy.getTestId('vault-form-cancel').should('be.enabled') - cy.getTestId('vault-form-submit').should('be.disabled') + cy.getTestId('vault-edit-form-cancel').should('be.visible') + cy.getTestId('vault-edit-form-submit').should('be.visible') + cy.getTestId('vault-edit-form-cancel').should('be.enabled') + cy.getTestId('vault-edit-form-submit').should('be.disabled') // form fields cy.getTestId('vault-form-prefix').should('have.value', vault.prefix) cy.getTestId('vault-form-description').should('have.value', vault.description) @@ -762,16 +762,16 @@ describe('', () => { cy.wait('@getVault') cy.get('.kong-ui-entities-vault-form').should('be.visible') // default button state - cy.getTestId('vault-form-cancel').should('be.visible') - cy.getTestId('vault-form-submit').should('be.visible') - cy.getTestId('vault-form-cancel').should('be.enabled') - cy.getTestId('vault-form-submit').should('be.disabled') + cy.getTestId('vault-edit-form-cancel').should('be.visible') + cy.getTestId('vault-edit-form-submit').should('be.visible') + cy.getTestId('vault-edit-form-cancel').should('be.enabled') + cy.getTestId('vault-edit-form-submit').should('be.disabled') // enables save when form has changes cy.getTestId('vault-form-config-kong-prefix').type('edited') - cy.getTestId('vault-form-submit').should('be.enabled') + cy.getTestId('vault-edit-form-submit').should('be.enabled') // disables save when required field is cleared cy.getTestId('vault-form-prefix').clear() - cy.getTestId('vault-form-submit').should('be.disabled') + cy.getTestId('vault-edit-form-submit').should('be.disabled') }) it('should handle error state - failed to load vault', () => { @@ -798,8 +798,8 @@ describe('', () => { // error state is displayed cy.getTestId('form-fetch-error').should('be.visible') // buttons and form hidden - cy.getTestId('vault-form-cancel').should('not.exist') - cy.getTestId('vault-form-submit').should('not.exist') + cy.getTestId('vault-edit-form-cancel').should('not.exist') + cy.getTestId('vault-edit-form-submit').should('not.exist') cy.get('.kong-ui-entities-vault-form form').should('not.exist') }) From f1268ccdbe2e4404bd9854b2f6fbbf59c9c262b5 Mon Sep 17 00:00:00 2001 From: tehkai Date: Wed, 21 Aug 2024 16:39:14 -0400 Subject: [PATCH 2/3] fix(*): test-id fixes --- .../src/components/CACertificateForm.cy.ts | 4 ++-- .../src/components/CertificateForm.cy.ts | 10 +++++----- .../src/components/GatewayServiceForm.cy.ts | 4 ++-- .../entities-key-sets/src/components/KeySetForm.cy.ts | 10 +++++----- .../entities-keys/src/components/KeyForm.cy.ts | 4 ++-- .../components/entity-base-form/EntityBaseForm.cy.ts | 4 ++-- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/entities/entities-certificates/src/components/CACertificateForm.cy.ts b/packages/entities/entities-certificates/src/components/CACertificateForm.cy.ts index a070aa22c8..b187a95099 100644 --- a/packages/entities/entities-certificates/src/components/CACertificateForm.cy.ts +++ b/packages/entities/entities-certificates/src/components/CACertificateForm.cy.ts @@ -260,8 +260,8 @@ describe('', () => { cy.getTestId('ca_certificate-create-form-cancel').should('be.enabled') cy.getTestId('ca_certificate-create-form-submit').should('be.disabled') // form fields - cy.getTestId('ca-certificate-create-form-cert').should('be.visible') - cy.getTestId('ca-certificate-create-form-cert-digest').should('be.visible') + cy.getTestId('ca-certificate-form-cert').should('be.visible') + cy.getTestId('ca-certificate-form-cert-digest').should('be.visible') cy.getTestId('ca-certificate-form-tags').should('be.visible') }) diff --git a/packages/entities/entities-certificates/src/components/CertificateForm.cy.ts b/packages/entities/entities-certificates/src/components/CertificateForm.cy.ts index f80939af4d..5a3038df40 100644 --- a/packages/entities/entities-certificates/src/components/CertificateForm.cy.ts +++ b/packages/entities/entities-certificates/src/components/CertificateForm.cy.ts @@ -481,9 +481,9 @@ describe('', () => { cy.wait('@getCertificate') cy.get('.kong-ui-entities-certificates-form').should('be.visible') // button state + cy.getTestId('certificate-edit-form-cancel').should('be.visible') cy.getTestId('certificate-edit-form-submit').should('be.visible') - cy.getTestId('certificate-edit-form-submit').should('be.visible') - cy.getTestId('certificate-edit-form-submit').should('be.enabled') + cy.getTestId('certificate-edit-form-cancel').should('be.enabled') cy.getTestId('certificate-edit-form-submit').should('be.disabled') // form fields cy.getTestId('certificate-form-cert').should('have.value', certificate1.cert) @@ -503,9 +503,9 @@ describe('', () => { cy.wait('@getCertificate') cy.get('.kong-ui-entities-certificates-form').should('be.visible') // default button state + cy.getTestId('certificate-edit-form-cancel').should('be.visible') cy.getTestId('certificate-edit-form-submit').should('be.visible') - cy.getTestId('certificate-edit-form-submit').should('be.visible') - cy.getTestId('certificate-edit-form-submit').should('be.enabled') + cy.getTestId('certificate-edit-form-cancel').should('be.enabled') cy.getTestId('certificate-edit-form-submit').should('be.disabled') // enables save when form has changes cy.getTestId('certificate-form-cert-alt').type('edited') @@ -539,7 +539,7 @@ describe('', () => { // error state is displayed cy.getTestId('form-fetch-error').should('be.visible') // buttons and form hidden - cy.getTestId('certificate-edit-form-submit').should('not.exist') + cy.getTestId('certificate-edit-form-cancel').should('not.exist') cy.getTestId('certificate-edit-form-submit').should('not.exist') cy.get('.kong-ui-entities-certificates-form form').should('not.exist') }) diff --git a/packages/entities/entities-gateway-services/src/components/GatewayServiceForm.cy.ts b/packages/entities/entities-gateway-services/src/components/GatewayServiceForm.cy.ts index 911e28c700..e57dfd8540 100644 --- a/packages/entities/entities-gateway-services/src/components/GatewayServiceForm.cy.ts +++ b/packages/entities/entities-gateway-services/src/components/GatewayServiceForm.cy.ts @@ -340,8 +340,8 @@ describe('', { viewportHeight: 800, viewportWidth: 700 }, cy.wait('@getGatewayService') cy.get('.kong-ui-entities-gateway-service-form').should('be.visible') // view configuration cta - cy.getTestId('service-form-view-configuration').should('be.visible') - cy.getTestId('service-form-view-configuration').click() + cy.getTestId('service-edit-form-view-configuration').should('be.visible') + cy.getTestId('service-edit-form-view-configuration').click() cy.getTestId('highlighted-code-block').should('be.visible') }) diff --git a/packages/entities/entities-key-sets/src/components/KeySetForm.cy.ts b/packages/entities/entities-key-sets/src/components/KeySetForm.cy.ts index bab04f225d..de131ff2c0 100644 --- a/packages/entities/entities-key-sets/src/components/KeySetForm.cy.ts +++ b/packages/entities/entities-key-sets/src/components/KeySetForm.cy.ts @@ -281,9 +281,9 @@ describe('', () => { cy.wait('@getKeySet') cy.get('.kong-ui-entities-key-sets-form').should('be.visible') // button state + cy.getTestId('set-edit-form-cancel').should('be.visible') cy.getTestId('set-edit-form-submit').should('be.visible') - cy.getTestId('set-edit-form-submit').should('be.visible') - cy.getTestId('set-edit-form-submit').should('be.enabled') + cy.getTestId('set-edit-form-cancel').should('be.enabled') cy.getTestId('set-edit-form-submit').should('be.disabled') // form fields cy.getTestId('key-set-form-name').should('have.value', keySet1.name) @@ -307,9 +307,9 @@ describe('', () => { cy.wait('@getKeySet') cy.get('.kong-ui-entities-key-sets-form').should('be.visible') // default button state + cy.getTestId('set-edit-form-cancel').should('be.visible') cy.getTestId('set-edit-form-submit').should('be.visible') - cy.getTestId('set-edit-form-submit').should('be.visible') - cy.getTestId('set-edit-form-submit').should('be.enabled') + cy.getTestId('set-edit-form-cancel').should('be.enabled') cy.getTestId('set-edit-form-submit').should('be.disabled') // enables save when form has changes cy.getTestId('key-set-form-name').type('-edited') @@ -344,7 +344,7 @@ describe('', () => { // error state is displayed cy.getTestId('form-fetch-error').should('be.visible') // buttons and form hidden - cy.getTestId('set-edit-form-submit').should('not.exist') + cy.getTestId('set-edit-form-cancel').should('not.exist') cy.getTestId('set-edit-form-submit').should('not.exist') cy.get('.kong-ui-entities-key-sets-form form').should('not.exist') }) diff --git a/packages/entities/entities-keys/src/components/KeyForm.cy.ts b/packages/entities/entities-keys/src/components/KeyForm.cy.ts index a8c0173ba2..09d2c5e72b 100644 --- a/packages/entities/entities-keys/src/components/KeyForm.cy.ts +++ b/packages/entities/entities-keys/src/components/KeyForm.cy.ts @@ -242,7 +242,7 @@ describe('', () => { cy.getTestId('key-form-key-set').click() cy.get(`[data-testid="select-item-${keySets.data[0].id}"] button`).click() cy.getTestId('key-form-jwk').type(jwkString, { delay: 0 }) - cy.getTestId('key-edit-form-submit').click() + cy.getTestId('key-create-form-submit').click() cy.wait('@createKey') }) @@ -763,7 +763,7 @@ describe('', () => { cy.getTestId('key-form-key-set').click() cy.get(`[data-testid="select-item-${keySets.data[0].id}"] button`).click() cy.getTestId('key-form-jwk').type(jwkString, { delay: 0 }) - cy.getTestId('key-edit-form-submit').click() + cy.getTestId('key-create-form-submit').click() cy.wait('@createKey') }) diff --git a/packages/entities/entities-shared/src/components/entity-base-form/EntityBaseForm.cy.ts b/packages/entities/entities-shared/src/components/entity-base-form/EntityBaseForm.cy.ts index e7196a0f2c..e11248e16e 100644 --- a/packages/entities/entities-shared/src/components/entity-base-form/EntityBaseForm.cy.ts +++ b/packages/entities/entities-shared/src/components/entity-base-form/EntityBaseForm.cy.ts @@ -63,8 +63,8 @@ describe('', () => { }, }) - cy.getTestId(`${entityType}-form-view-configuration`).should('be.visible') - cy.getTestId(`${entityType}-form-view-configuration`).click() + cy.getTestId(`${entityType}-create-form-view-configuration`).should('be.visible') + cy.getTestId(`${entityType}-create-form-view-configuration`).click() cy.getTestId('form-view-configuration-slideout').should('exist') cy.getTestId('form-view-configuration-slideout-tabs').should('exist') From d49aa35cd97d30ba5d893af50e308296a0ad7982 Mon Sep 17 00:00:00 2001 From: tehkai Date: Wed, 21 Aug 2024 16:47:04 -0400 Subject: [PATCH 3/3] fix(*): test-id fixes --- .../entities-certificates/src/components/CertificateForm.cy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/entities/entities-certificates/src/components/CertificateForm.cy.ts b/packages/entities/entities-certificates/src/components/CertificateForm.cy.ts index 5a3038df40..1aa3465021 100644 --- a/packages/entities/entities-certificates/src/components/CertificateForm.cy.ts +++ b/packages/entities/entities-certificates/src/components/CertificateForm.cy.ts @@ -236,7 +236,7 @@ describe('', () => { cy.getTestId('form-fetch-error').should('be.visible') // buttons and form hidden cy.getTestId('certificate-edit-form-cancel').should('not.exist') - cy.getTestId('certificate-create-form-submit').should('not.exist') + cy.getTestId('certificate-edit-form-submit').should('not.exist') cy.get('.kong-ui-entities-certificates-form form').should('not.exist') })