mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-27 21:49:41 -08:00
95b97078e8
* add tests * ci: Setup cypress tasks for resetting DB, and setting up an owner * add test tests to check for settings * add more tests * clean up * rename tag * update test id Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
32 lines
1.3 KiB
TypeScript
32 lines
1.3 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'),
|
|
editCredentialModal: () => cy.getByTestId('editCredential-modal', { timeout: 5000 }),
|
|
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'),
|
|
closeButton: () => this.getters.editCredentialModal().find('.el-dialog__close'),
|
|
};
|
|
actions = {
|
|
setName: (name: string) => {
|
|
this.getters.name().click();
|
|
this.getters.nameInput().clear().type(name);
|
|
},
|
|
save: () => {
|
|
this.getters.saveButton().click();
|
|
},
|
|
close: () => {
|
|
this.getters.closeButton().click();
|
|
},
|
|
};
|
|
}
|