mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat: Add credentials E2E test suite and page object (#4596)
* fix: Fix inferred type of X cannot be named error after pnpm update * feat: Change page objects to expose actions and getters. Add credential creation suite
This commit is contained in:
26
cypress/pages/modals/credentials-modal.ts
Normal file
26
cypress/pages/modals/credentials-modal.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { BasePage } from "../base";
|
||||
|
||||
export class CredentialsModal extends BasePage {
|
||||
getters = {
|
||||
newCredentialModal: () => cy.getByTestId('selectCredential-modal', { timeout: 5000 }),
|
||||
newCredentialTypeSelect: () => cy.getByTestId('new-credential-type-select'),
|
||||
newCredentialTypeOption: (credentialType: string) => cy.getByTestId('new-credential-type-select-option').contains(credentialType),
|
||||
newCredentialTypeButton: () => cy.getByTestId('new-credential-type-button'),
|
||||
connectionParameters: () => cy.getByTestId('credential-connection-parameter'),
|
||||
connectionParameter: (fieldName: string) => this.getters.connectionParameters().contains(fieldName)
|
||||
.parents('[data-test-id="credential-connection-parameter"]')
|
||||
.find('.n8n-input input'),
|
||||
name: () => cy.getByTestId('credential-name'),
|
||||
nameInput: () => cy.getByTestId('credential-name').find('input'),
|
||||
saveButton: () => cy.getByTestId('credential-save-button')
|
||||
};
|
||||
actions = {
|
||||
setName: (name: string) => {
|
||||
this.getters.name().click();
|
||||
this.getters.nameInput().clear().type(name);
|
||||
},
|
||||
save: () => {
|
||||
this.getters.saveButton().click();
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user