mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-13 05:47:31 -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
42 lines
1.4 KiB
TypeScript
42 lines
1.4 KiB
TypeScript
import { DEFAULT_USER_EMAIL, DEFAULT_USER_PASSWORD } from "../constants";
|
|
import { randFirstName, randLastName } from "@ngneat/falso";
|
|
import { CredentialsPage, CredentialsModal } from '../pages';
|
|
// import { v4 as uuid } from 'uuid';
|
|
|
|
const username = DEFAULT_USER_EMAIL;
|
|
const password = DEFAULT_USER_PASSWORD;
|
|
const firstName = randFirstName();
|
|
const lastName = randLastName();
|
|
const credentialsPage = new CredentialsPage();
|
|
const credentialsModal = new CredentialsModal();
|
|
|
|
describe('Credentials', () => {
|
|
beforeEach(() => {
|
|
cy.signup(username, firstName, lastName, password);
|
|
|
|
cy.on('uncaught:exception', (err, runnable) => {
|
|
expect(err.message).to.include('Not logged in');
|
|
|
|
return false;
|
|
})
|
|
|
|
cy.signin(username, password);
|
|
cy.visit(credentialsPage.url);
|
|
});
|
|
|
|
it('should create a new credential using empty state', () => {
|
|
credentialsPage.getters.emptyListCreateCredentialButton().click();
|
|
|
|
credentialsModal.getters.newCredentialModal().should('be.visible');
|
|
credentialsModal.getters.newCredentialTypeSelect().should('be.visible');
|
|
credentialsModal.getters.newCredentialTypeOption('Notion API').click();
|
|
|
|
credentialsModal.getters.newCredentialTypeButton().click();
|
|
|
|
credentialsModal.getters.connectionParameter('API Key').type('1234567890');
|
|
|
|
credentialsModal.actions.setName('My awesome Notion account');
|
|
credentialsModal.actions.save();
|
|
});
|
|
});
|