Skip to content

Commit

Permalink
fix: migrate cypress to playwright
Browse files Browse the repository at this point in the history
  • Loading branch information
tatarco committed May 22, 2024
1 parent a8aa789 commit b11b151
Show file tree
Hide file tree
Showing 122 changed files with 6,388 additions and 5,334 deletions.
2 changes: 1 addition & 1 deletion .idea/nx-angular-config.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions .idea/runConfigurations/API___TEST.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions .idea/runConfigurations/WEB.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions .idea/runConfigurations/WORKER.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/web/.env
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ REACT_APP_SEGMENT_KEY=
REACT_APP_SENTRY_DSN=
REACT_APP_BLUEPRINTS_API_URL=
REACT_APP_MAIL_SERVER_DOMAIN=
REACT_APP_LAUNCH_DARKLY_CLIENT_SIDE_ID=
REACT_APP_LAUNCH_DARKLY_CLIENT_SIDE_ID=some_fake_id
IS_TEMPLATE_STORE_ENABLED=
IS_MULTI_PROVIDER_CONFIGURATION_ENABLED=
REACT_APP_NOVU_GTM_ID=
1 change: 1 addition & 0 deletions apps/web/.env.playwirght.test
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
NODE_ENV=test
MONGODB_URL=mongodb://127.0.0.1:27017/novu-test
API_URL=http://127.0.0.1:1336
BLUEPRINT_CREATOR='645b648b36dd6d25f8650d37'
1 change: 0 additions & 1 deletion apps/web/cypress/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ module.exports = (on, config) => {
const service = new NotificationsService(token);
const session = new UserSession(config.env.API_URL);

// eslint-disable-next-line no-plusplus
for (let i = 0; i < count; i++) {
await service.triggerEvent(triggerIdentifier, subId, {});
}
Expand Down
70 changes: 0 additions & 70 deletions apps/web/cypress/tests/activities-page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,6 @@ describe('Activity Feed Screen', function () {
});
});

it('should display notification for activity', function () {
cy.visit('/activities');
cy.getByTestId('activities-table')
.find('button')
.first()
.getByTestId('row-template-name')
.contains(this.session.templates[0].name);

cy.getByTestId('activities-table').find('button').first().getByTestId('in_app-step').should('exist');
cy.getByTestId('activities-table').find('button').first().getByTestId('email-step').should('exist');
cy.getByTestId('activities-table').find('button').first().getByTestId('subscriber-id').should('exist');
});

it('should show errors and warning', function () {
cy.intercept(/.*notifications\?page.*/, (r) => {
r.continue((res) => {
Expand All @@ -48,61 +35,4 @@ describe('Activity Feed Screen', function () {
.should('have.css', 'color')
.and('eq', 'rgb(229, 69, 69)');
});

it('should filter by email channel', function () {
cy.visit('/activities');
cy.waitForNetworkIdle(500);

cy.getByTestId('email-step').should('have.length', 10);
cy.getByTestId('activities-filter').click();
cy.get('.mantine-MultiSelect-item').contains('SMS').click();
cy.getByTestId('submit-filters').click();
cy.getByTestId('email-step').should('have.length', 0);
});

it('should show the clear filters button when template is selected', function () {
cy.visit('/activities');
cy.waitForNetworkIdle(500);

cy.getByTestId('email-step').should('have.length', 10);

cy.getByTestId('templates-filter').click({ force: true });
cy.get('.mantine-MultiSelect-item').contains(this.session.templates[0].name).click({ force: true });

cy.getByTestId('activities-table')
.find('button')
.first()
.getByTestId('row-template-name')
.contains(this.session.templates[0].name);

cy.getByTestId('clear-filters').should('exist');
cy.getByTestId('clear-filters').click({ force: true });

cy.getByTestId('templates-filter').find('.mantine-Text-root').should('not.exist');
cy.getByTestId('email-step').should('have.length', 10);
});

it('should clear all filters', function () {
cy.visit('/activities');
cy.waitForNetworkIdle(500);

cy.getByTestId('email-step').should('have.length', 10);

cy.getByTestId('activities-filter').click();
cy.get('.mantine-MultiSelect-item').contains('Email').click();
cy.getByTestId('templates-filter').click();
cy.get('.mantine-MultiSelect-item').contains(this.session.templates[0].name).click();
cy.getByTestId('transactionId-filter').type('test');
cy.getByTestId('subscriberId-filter').type('test');

cy.getByTestId('clear-filters').should('exist');
cy.getByTestId('clear-filters').click();

cy.getByTestId('activities-filter').find('.mantine-Text-root').should('not.exist');
cy.getByTestId('templates-filter').find('.mantine-Text-root').should('not.exist');
cy.getByTestId('transactionId-filter').should('not.have.value');
cy.getByTestId('subscriberId-filter').should('not.have.value');

cy.getByTestId('email-step').should('have.length', 10);
});
});
3 changes: 0 additions & 3 deletions apps/web/cypress/tests/activity-graph.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/
describe.skip('Activity page', function () {
beforeEach(function () {
// @ts-expect-error
cy.initializeSession()
.as('session')
.then((session: any) => {
Expand All @@ -21,8 +20,6 @@ describe.skip('Activity page', function () {
it('should display email available for connection', function () {
cy.visit('/activities');
cy.location('pathname').should('equal', '/activities');

// @ts-expect-error
cy.getByTestId('activity-stats-weekly-sent').contains('25');
});
});
Loading

0 comments on commit b11b151

Please sign in to comment.