Skip to content

Instantly share code, notes, and snippets.

@Leming1488
Last active January 11, 2021 03:46
Show Gist options
  • Select an option

  • Save Leming1488/42e9f2ac64dcb1145c0639c435e63e28 to your computer and use it in GitHub Desktop.

Select an option

Save Leming1488/42e9f2ac64dcb1145c0639c435e63e28 to your computer and use it in GitHub Desktop.

Revisions

  1. Leming1488 revised this gist Jan 11, 2021. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions authentication_before.spec.js
    Original file line number Diff line number Diff line change
    @@ -3,8 +3,8 @@ describe('Authentication User', () => {
    cy.clearCookies();

    cy.visit('/', {
    onBeforeLoad(win) {
    delete win.fetch;
    onBeforeLoad(window) {
    delete window.fetch;
    }
    });

  2. Leming1488 revised this gist Jan 11, 2021. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions authentication_before.spec.js
    Original file line number Diff line number Diff line change
    @@ -8,5 +8,7 @@ describe('Authentication User', () => {
    }
    });

    cy.url().should('include', 'login');
    cy.get('[data-cy=login]').should('exist');
    });
    });
  3. Leming1488 revised this gist Jan 11, 2021. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion authentication_before.spec.js
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,12 @@
    describe('Authentication User', () => {
    before(() => {
    cy.clearCookies();
    cy.visit('/login', {

    cy.visit('/', {
    onBeforeLoad(win) {
    delete win.fetch;
    }
    });

    });
    });
  4. Leming1488 revised this gist Jan 11, 2021. 1 changed file with 1 addition and 13 deletions.
    14 changes: 1 addition & 13 deletions authentication_before.spec.js
    Original file line number Diff line number Diff line change
    @@ -1,22 +1,10 @@
    describe('Authentication User', () => {
    before(() => {
    cy.server();

    cy.route({
    method: 'GET',
    url: '/api/users/info*',
    response: errors.error_401,
    status: 401
    }).as('userInfo');

    cy.clearCookies();

    cy.visit('/dashboard', {
    cy.visit('/login', {
    onBeforeLoad(win) {
    delete win.fetch;
    }
    });

    cy.wait(['@userInfo']);
    });
    });
  5. Leming1488 created this gist Sep 23, 2020.
    22 changes: 22 additions & 0 deletions authentication_before.spec.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    describe('Authentication User', () => {
    before(() => {
    cy.server();

    cy.route({
    method: 'GET',
    url: '/api/users/info*',
    response: errors.error_401,
    status: 401
    }).as('userInfo');

    cy.clearCookies();

    cy.visit('/dashboard', {
    onBeforeLoad(win) {
    delete win.fetch;
    }
    });

    cy.wait(['@userInfo']);
    });
    });