style: auto format whole project
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const { defineConfig } = require("cypress");
|
||||
const { defineConfig } = require('cypress');
|
||||
|
||||
const TO_BE_PROVIDED = 'HAS_TO_BE_PROVIDED_IN_cypress.env.json';
|
||||
|
||||
@@ -6,12 +6,12 @@ module.exports = defineConfig({
|
||||
e2e: {
|
||||
baseUrl: 'http://localhost:3001',
|
||||
env: {
|
||||
login_email: "user@automatisch.io",
|
||||
login_password: "sample",
|
||||
login_email: 'user@automatisch.io',
|
||||
login_password: 'sample',
|
||||
slack_user_token: TO_BE_PROVIDED,
|
||||
},
|
||||
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
|
||||
viewportWidth: 1280,
|
||||
viewportHeight: 768
|
||||
viewportHeight: 768,
|
||||
},
|
||||
});
|
||||
|
@@ -47,4 +47,4 @@ describe('Apps page', () => {
|
||||
cy.og('add-app-connection-dialog').should('not.exist');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -23,24 +23,17 @@ describe('Connections page', () => {
|
||||
|
||||
context('can add connection', () => {
|
||||
it('has a button to open add connection dialog', () => {
|
||||
cy
|
||||
.og('add-connection-button')
|
||||
.scrollIntoView()
|
||||
.should('be.visible');
|
||||
cy.og('add-connection-button').scrollIntoView().should('be.visible');
|
||||
});
|
||||
|
||||
it('add connection button takes user to add connection page', () => {
|
||||
cy
|
||||
.og('add-connection-button')
|
||||
.click({ force: true });
|
||||
cy.og('add-connection-button').click({ force: true });
|
||||
|
||||
cy.location('pathname').should('equal', '/app/slack/connections/add');
|
||||
});
|
||||
|
||||
it('shows add connection dialog to create a new connection', () => {
|
||||
cy
|
||||
.get('input[name="accessToken"]')
|
||||
.type(Cypress.env('slack_user_token'));
|
||||
cy.get('input[name="accessToken"]').type(Cypress.env('slack_user_token'));
|
||||
|
||||
cy.og('create-connection-button').click();
|
||||
|
||||
|
@@ -31,4 +31,4 @@ describe('Execution page', () => {
|
||||
|
||||
cy.ss('Execution - error');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -17,4 +17,4 @@ describe('Executions page', () => {
|
||||
|
||||
cy.ss('Executions');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -27,10 +27,7 @@ describe('Flow editor page', () => {
|
||||
});
|
||||
|
||||
it('choose an event', () => {
|
||||
cy
|
||||
.og('choose-event-autocomplete')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
cy.og('choose-event-autocomplete').should('be.visible').click();
|
||||
|
||||
cy.get('li[role="option"]:contains("Every hour")').click();
|
||||
});
|
||||
@@ -42,13 +39,12 @@ describe('Flow editor page', () => {
|
||||
it('collapses the substep', () => {
|
||||
cy.og('choose-app-autocomplete').should('not.be.visible');
|
||||
cy.og('choose-event-autocomplete').should('not.be.visible');
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
context('set up a trigger', () => {
|
||||
it('choose "yes" in "trigger on weekends?"', () => {
|
||||
cy
|
||||
.og('parameters.triggersOnWeekend-autocomplete')
|
||||
cy.og('parameters.triggersOnWeekend-autocomplete')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
|
||||
@@ -60,7 +56,9 @@ describe('Flow editor page', () => {
|
||||
});
|
||||
|
||||
it('collapses the substep', () => {
|
||||
cy.og('parameters.triggersOnWeekend-autocomplete').should('not.exist');
|
||||
cy.og('parameters.triggersOnWeekend-autocomplete').should(
|
||||
'not.exist'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -88,12 +86,11 @@ describe('Flow editor page', () => {
|
||||
});
|
||||
|
||||
it('choose an event', () => {
|
||||
cy
|
||||
.og('choose-event-autocomplete')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
cy.og('choose-event-autocomplete').should('be.visible').click();
|
||||
|
||||
cy.get('li[role="option"]:contains("Send a message to channel")').click();
|
||||
cy.get(
|
||||
'li[role="option"]:contains("Send a message to channel")'
|
||||
).click();
|
||||
});
|
||||
|
||||
it('continue to next step', () => {
|
||||
@@ -130,14 +127,16 @@ describe('Flow editor page', () => {
|
||||
});
|
||||
|
||||
it('arrange message text', () => {
|
||||
cy
|
||||
.og('power-input', ' [contenteditable]')
|
||||
cy.og('power-input', ' [contenteditable]')
|
||||
.click()
|
||||
.type(`Hello from e2e tests! Here is the first suggested variable's value; `);
|
||||
.type(
|
||||
`Hello from e2e tests! Here is the first suggested variable's value; `
|
||||
);
|
||||
|
||||
cy
|
||||
.og('power-input-suggestion-group').first()
|
||||
.og('power-input-suggestion-item').first()
|
||||
cy.og('power-input-suggestion-group')
|
||||
.first()
|
||||
.og('power-input-suggestion-item')
|
||||
.first()
|
||||
.click();
|
||||
|
||||
cy.clickOutside();
|
||||
@@ -150,9 +149,7 @@ describe('Flow editor page', () => {
|
||||
});
|
||||
|
||||
it('collapses the substep', () => {
|
||||
cy
|
||||
.og('power-input', ' [contenteditable]')
|
||||
.should('not.exist');
|
||||
cy.og('power-input', ' [contenteditable]').should('not.exist');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -176,10 +173,7 @@ describe('Flow editor page', () => {
|
||||
it('publish flow', () => {
|
||||
cy.og('unpublish-flow-button').should('not.exist');
|
||||
|
||||
cy
|
||||
.og('publish-flow-button')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
cy.og('publish-flow-button').should('be.visible').click();
|
||||
|
||||
cy.og('publish-flow-button').should('not.exist');
|
||||
});
|
||||
@@ -191,27 +185,19 @@ describe('Flow editor page', () => {
|
||||
});
|
||||
|
||||
it('unpublish from snackbar', () => {
|
||||
cy
|
||||
.og('unpublish-flow-from-snackbar')
|
||||
.click();
|
||||
cy.og('unpublish-flow-from-snackbar').click();
|
||||
|
||||
cy.og('flow-cannot-edit-info-snackbar').should('not.exist');
|
||||
})
|
||||
});
|
||||
|
||||
it('publish once again', () => {
|
||||
cy
|
||||
.og('publish-flow-button')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
cy.og('publish-flow-button').should('be.visible').click();
|
||||
|
||||
cy.og('publish-flow-button').should('not.exist');
|
||||
});
|
||||
|
||||
it('unpublish from layout top bar', () => {
|
||||
cy
|
||||
.og('unpublish-flow-button')
|
||||
.should('be.visible')
|
||||
.click();
|
||||
cy.og('unpublish-flow-button').should('be.visible').click();
|
||||
|
||||
cy.og('unpublish-flow-button').should('not.exist');
|
||||
|
||||
|
@@ -1,10 +1,14 @@
|
||||
Cypress.Commands.add('og', { prevSubject: 'optional' }, (subject, selector, suffix = '') => {
|
||||
if (subject) {
|
||||
return cy.wrap(subject).get(`[data-test="${selector}"]${suffix}`);
|
||||
}
|
||||
Cypress.Commands.add(
|
||||
'og',
|
||||
{ prevSubject: 'optional' },
|
||||
(subject, selector, suffix = '') => {
|
||||
if (subject) {
|
||||
return cy.wrap(subject).get(`[data-test="${selector}"]${suffix}`);
|
||||
}
|
||||
|
||||
return cy.get(`[data-test="${selector}"]${suffix}`);
|
||||
});
|
||||
return cy.get(`[data-test="${selector}"]${suffix}`);
|
||||
}
|
||||
);
|
||||
|
||||
Cypress.Commands.add('login', () => {
|
||||
cy.visit('/login');
|
||||
@@ -12,12 +16,10 @@ Cypress.Commands.add('login', () => {
|
||||
cy.og('email-text-field').type(Cypress.env('login_email'));
|
||||
cy.og('password-text-field').type(Cypress.env('login_password'));
|
||||
|
||||
cy
|
||||
.intercept('/graphql')
|
||||
.as('graphqlCalls');
|
||||
cy
|
||||
.intercept('https://notifications.automatisch.io/notifications.json')
|
||||
.as('notificationsCall');
|
||||
cy.intercept('/graphql').as('graphqlCalls');
|
||||
cy.intercept('https://notifications.automatisch.io/notifications.json').as(
|
||||
'notificationsCall'
|
||||
);
|
||||
cy.og('login-button').click();
|
||||
|
||||
cy.wait(['@graphqlCalls', '@notificationsCall']);
|
||||
@@ -30,14 +32,11 @@ Cypress.Commands.add('logout', () => {
|
||||
});
|
||||
|
||||
Cypress.Commands.add('ss', (name, opts = {}) => {
|
||||
return cy.screenshot(
|
||||
name,
|
||||
{
|
||||
overwrite: true,
|
||||
capture: 'viewport',
|
||||
...opts,
|
||||
}
|
||||
);
|
||||
return cy.screenshot(name, {
|
||||
overwrite: true,
|
||||
capture: 'viewport',
|
||||
...opts,
|
||||
});
|
||||
});
|
||||
|
||||
Cypress.Commands.add('clickOutside', () => {
|
||||
|
@@ -14,7 +14,7 @@
|
||||
// ***********************************************************
|
||||
|
||||
// Import commands.js using ES2015 syntax:
|
||||
import './commands'
|
||||
import './commands';
|
||||
|
||||
// Alternatively you can use CommonJS syntax:
|
||||
// require('./commands')
|
||||
// require('./commands')
|
||||
|
Reference in New Issue
Block a user