fix(ui): fix ui E2E tests with magic

This commit is contained in:
nick-delirium 2023-06-05 13:07:52 +02:00
parent 0fb8177ce0
commit 9cedd798be
19 changed files with 52 additions and 48 deletions

View file

@ -41,8 +41,9 @@ function DefaultMenuView(props: Props) {
to={withSiteId(SESSIONS_PATH, siteId)}
className={styles.nav}
activeClassName={styles.active}
data-test-id={"sessions"}
>
{'Sessions'}
Sessions
</NavLink>
<NavLink
to={withSiteId(ASSIST_PATH, siteId)}
@ -53,8 +54,9 @@ function DefaultMenuView(props: Props) {
location.pathname.includes(ASSIST_PATH) || location.pathname.includes(RECORDINGS_PATH)
);
}}
data-test-id={"assist"}
>
{'Assist'}
Assist
</NavLink>
<NavLink
to={withSiteId(DASHBOARD_PATH, siteId)}
@ -65,8 +67,9 @@ function DefaultMenuView(props: Props) {
location.pathname.includes(DASHBOARD_PATH) || location.pathname.includes(METRICS_PATH)
);
}}
data-test-id={"dashboards"}
>
<span>{'Dashboards'}</span>
Dashboards
</NavLink>
</div>
);

View file

@ -14,7 +14,7 @@ describe('Testing general stability', {
cy.get('#search').should('be.visible')
cy.get('[href="/2/dashboard"] > span').click()
cy.get('[data-test-id="dashboards"]').click()
cy.get(':nth-child(1) > .relative > :nth-child(1) > #menu-manage-alerts > .w-full').should('be.visible')

View file

@ -60,7 +60,7 @@ describe(
cy.wait(SECOND * 180);
cy.visit(firstAlias.slice(27) + '?freeze=true');
cy.log('loading session')
cy.wait(SECOND * 25);
cy.wait(SECOND * 10);
cy.window().then(win => {
const jumpMethod = win.playerJump ? win.playerJump : win.playerJumpToTime
@ -103,48 +103,49 @@ describe(
});
});
it('Checking Replayer at breakpoints, user events and console', () => {
cy.intercept('**/api/account').as('getAccount')
cy.intercept('**/mobs/7585361734083637/dom.mobs?*').as('getFirstMob')
cy.intercept('**/mobs/7585361734083637/dom.mobe?*').as('getSecondMob')
cy.log('testing premade session')
cy.visit('http://0.0.0.0:3333', {
onBeforeLoad: function (window) {
window.localStorage.setItem('notesFeatureViewed', 'true');
}
})
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')
cy.wait(SECOND * 2)
cy.visit('3/session/7585361734083637?jumpto=7500&freeze=true')
cy.wait('@getFirstMob')
cy.wait('@getSecondMob')
cy.wait(SECOND * 2)
cy.window().then(win => {
const jumpMethod = win.playerJump ? win.playerJump : win.playerJumpToTime
jumpMethod(SECOND * 7.5)
})
cy.wait(SECOND * 4)
cy.matchImageSnapshot('1st-breakpoint');
cy.window().then(win => {
const jumpMethod = win.playerJump ? win.playerJump : win.playerJumpToTime
jumpMethod(SECOND * 21)
})
cy.wait(SECOND * 4)
cy.matchImageSnapshot('2nd-breakpoint');
cy.get('[data-openreplay-label="User Steps"]').click()
cy.wait(SECOND * 0.5)
cy.matchImageSnapshot('User-Events');
cy.get('#control-button-network > .controlButton-module__label--YznMl').click()
cy.wait(SECOND * 0.5)
cy.matchImageSnapshot('Network-Events');
})
// this session is long gone
// it('Checking Replayer at breakpoints, user events and console', () => {
// cy.intercept('**/api/account').as('getAccount')
// cy.intercept('**/mobs/7585361734083637/dom.mobs?*').as('getFirstMob')
// cy.intercept('**/mobs/7585361734083637/dom.mobe?*').as('getSecondMob')
// cy.log('testing premade session')
//
// cy.visit('http://0.0.0.0:3333', {
// onBeforeLoad: function (window) {
// window.localStorage.setItem('notesFeatureViewed', 'true');
// }
// })
// 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')
// cy.wait(SECOND * 2)
// cy.visit('3/session/7585361734083637?jumpto=7500&freeze=true')
// cy.wait('@getFirstMob')
// cy.wait('@getSecondMob')
// cy.wait(SECOND * 2)
//
// cy.window().then(win => {
// const jumpMethod = win.playerJump ? win.playerJump : win.playerJumpToTime
// jumpMethod(SECOND * 7.5)
// })
// cy.wait(SECOND * 4)
// cy.matchImageSnapshot('1st-breakpoint');
//
// cy.window().then(win => {
// const jumpMethod = win.playerJump ? win.playerJump : win.playerJumpToTime
// jumpMethod(SECOND * 21)
// })
// cy.wait(SECOND * 4)
// cy.matchImageSnapshot('2nd-breakpoint');
//
// cy.get('[data-openreplay-label="User Steps"]').click()
// cy.wait(SECOND * 0.5)
// cy.matchImageSnapshot('User-Events');
//
// cy.get('#control-button-network > .controlButton-module__label--YznMl').click()
// cy.wait(SECOND * 0.5)
// cy.matchImageSnapshot('Network-Events');
// })
}
);

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 219 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 375 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 KiB