From 68b0c84a4db776f66d5b20f686abc05a17d2b3a4 Mon Sep 17 00:00:00 2001 From: nick-delirium Date: Fri, 10 Feb 2023 10:45:57 +0100 Subject: [PATCH] fix(ui): unlock tracker tests --- frontend/cypress/e2e/replayer.cy.ts | 190 ++++++++++++++-------------- 1 file changed, 95 insertions(+), 95 deletions(-) diff --git a/frontend/cypress/e2e/replayer.cy.ts b/frontend/cypress/e2e/replayer.cy.ts index ea6472e2e..4c764498e 100644 --- a/frontend/cypress/e2e/replayer.cy.ts +++ b/frontend/cypress/e2e/replayer.cy.ts @@ -7,101 +7,101 @@ describe( viewportWidth: 1400, }, () => { - // it('Testing generated tracker session', () => { - // cy.intercept('**/api/account').as('getAccount'); - // cy.intercept('**/dom.mobs?*').as('getFirstMob') - // - // cy.visit('http://0.0.0.0:3333', { - // onBeforeLoad: function (window) { - // window.localStorage.setItem('notesFeatureViewed', 'true'); - // }, - // }); - // - // cy.origin('http://localhost:3000/', { args: { SECOND } }, ({ SECOND }) => { - // cy.visit('/'); - // cy.wait(SECOND * 3); - // cy.get('#get-table').click() - // cy.wait(SECOND * 3); - // cy.get('#testrender').click(); - // cy.wait(SECOND * 3); - // cy.get('#testrender').click(); - // cy.get('#get-main').click() - // - // cy.get('#obscured-text').type('testing typing in obscured input'); - // cy.get('#visible-input').type('testing typing in visible input'); - // cy.wait(SECOND * 3); - // - // cy.get('#redcounter').click().click().click(); - // cy.get('#test-api').click().click(); - // cy.get('#test-event').click().click(); - // cy.wait(SECOND * 3); - // - // cy.log('finished generating a session') - // - // cy.window().then((window) => { - // cy.task('setValue', { key: 'url', value: window.__OPENREPLAY__.app.getSessionURL() }); - // cy.log(window.__OPENREPLAY__.app.getSessionURL()); - // cy.wait(SECOND * 3) - // }); - // }); - // - // - // cy.task('getValue', 'url').as('firstAlias'); - // - // cy.visit('/'); - // cy.get('[data-test-id=login]').type(Cypress.env('account').replaceAll('"', '')); - // cy.get('[data-test-id=password]').type(Cypress.env('password').replaceAll('"', '')); - // cy.get('[data-test-id=log-button]').click(); - // cy.wait('@getAccount'); - // // checking real session - // cy.get('@firstAlias').then((firstAlias) => { - // cy.log(firstAlias); - // cy.log('waiting for session to save') - // cy.wait(SECOND * 180); - // cy.visit(firstAlias.slice(27) + '?freeze=true'); - // cy.log('loading session') - // cy.wait(SECOND * 25); - // - // cy.window().then(win => { - // const jumpMethod = win.playerJump ? win.playerJump : win.playerJumpToTime - // jumpMethod(SECOND * 3) - // }) - // cy.wait(SECOND * 3); - // cy.matchImageSnapshot('Tracker-3'); - // - // cy.window().then(win => { - // win.playerJump(SECOND * 6) - // }) - // cy.wait(SECOND * 3); - // cy.matchImageSnapshot('Tracker-5'); - // - // cy.window().then(win => { - // const jumpMethod = win.playerJump ? win.playerJump : win.playerJumpToTime - // jumpMethod(SECOND * 9) - // }) - // cy.wait(SECOND * 3); - // cy.matchImageSnapshot('Tracker-9'); - // - // cy.window().then(win => { - // const jumpMethod = win.playerJump ? win.playerJump : win.playerJumpToTime - // jumpMethod(SECOND * 20) - // }) - // cy.wait(SECOND * 3); - // cy.get('#control-button-redux > .controlButton-module__label--YznMl').click() - // cy.wait(SECOND * 0.5) - // cy.matchImageSnapshot('Tracker-19-redux'); - // - // cy.get('#control-button-network').click() - // cy.wait(SECOND * 0.5) - // cy.matchImageSnapshot('Tracker-19-network'); - // - // cy.get('#control-button-events').click() - // cy.wait(SECOND * 0.5) - // cy.matchImageSnapshot('Tracker-19-events'); - // - // cy.log('custom session test success') - // }); - // }); + it('Testing generated tracker session', () => { + cy.intercept('**/api/account').as('getAccount'); + cy.intercept('**/dom.mobs?*').as('getFirstMob') + + cy.visit('http://0.0.0.0:3333', { + onBeforeLoad: function (window) { + window.localStorage.setItem('notesFeatureViewed', 'true'); + }, + }); + + cy.origin('http://localhost:3000/', { args: { SECOND } }, ({ SECOND }) => { + cy.visit('/'); + cy.wait(SECOND * 3); + cy.get('#get-table').click() + cy.wait(SECOND * 3); + cy.get('#testrender').click(); + cy.wait(SECOND * 3); + cy.get('#testrender').click(); + cy.get('#get-main').click() + + cy.get('#obscured-text').type('testing typing in obscured input'); + cy.get('#visible-input').type('testing typing in visible input'); + cy.wait(SECOND * 3); + + cy.get('#redcounter').click().click().click(); + cy.get('#test-api').click().click(); + cy.get('#test-event').click().click(); + cy.wait(SECOND * 3); + + cy.log('finished generating a session') + + cy.window().then((window) => { + cy.task('setValue', { key: 'url', value: window.__OPENREPLAY__.app.getSessionURL() }); + cy.log(window.__OPENREPLAY__.app.getSessionURL()); + cy.wait(SECOND * 3) + }); + }); + + + cy.task('getValue', 'url').as('firstAlias'); + + cy.visit('/'); + cy.get('[data-test-id=login]').type(Cypress.env('account').replaceAll('"', '')); + cy.get('[data-test-id=password]').type(Cypress.env('password').replaceAll('"', '')); + cy.get('[data-test-id=log-button]').click(); + cy.wait('@getAccount'); + // checking real session + cy.get('@firstAlias').then((firstAlias) => { + cy.log(firstAlias); + cy.log('waiting for session to save') + cy.wait(SECOND * 180); + cy.visit(firstAlias.slice(27) + '?freeze=true'); + cy.log('loading session') + cy.wait(SECOND * 25); + + cy.window().then(win => { + const jumpMethod = win.playerJump ? win.playerJump : win.playerJumpToTime + jumpMethod(SECOND * 3) + }) + cy.wait(SECOND * 3); + cy.matchImageSnapshot('Tracker-3'); + + cy.window().then(win => { + win.playerJump(SECOND * 6) + }) + cy.wait(SECOND * 3); + cy.matchImageSnapshot('Tracker-5'); + + cy.window().then(win => { + const jumpMethod = win.playerJump ? win.playerJump : win.playerJumpToTime + jumpMethod(SECOND * 9) + }) + cy.wait(SECOND * 3); + cy.matchImageSnapshot('Tracker-9'); + + cy.window().then(win => { + const jumpMethod = win.playerJump ? win.playerJump : win.playerJumpToTime + jumpMethod(SECOND * 20) + }) + cy.wait(SECOND * 3); + cy.get('#control-button-redux > .controlButton-module__label--YznMl').click() + cy.wait(SECOND * 0.5) + cy.matchImageSnapshot('Tracker-19-redux'); + + cy.get('#control-button-network').click() + cy.wait(SECOND * 0.5) + cy.matchImageSnapshot('Tracker-19-network'); + + cy.get('#control-button-events').click() + cy.wait(SECOND * 0.5) + cy.matchImageSnapshot('Tracker-19-events'); + + cy.log('custom session test success') + }); + }); it('Checking Replayer at breakpoints, user events and console', () => { cy.intercept('**/api/account').as('getAccount')