mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-14 00:24:07 -08:00
b5b44d1b59
* 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
27 lines
1.1 KiB
TypeScript
27 lines
1.1 KiB
TypeScript
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();
|
|
}
|
|
};
|
|
}
|