change(ui): adjust tests, add more browsers, cache and upload video on fail (#955)

* change(ui): adjust mob waiting timings...

* change(ui): adjust wait times for page render

* change(ui): adjust wait times for page render

* change(ui): adjust wait times for page render

* change(ui): adjust images

* change(ui): adjust images

* change(ui): adjust images

* change(ui): adjust timings

* change(ui): adjust timings

* change(ui): adjust timings

* change(ui): rm slack msg

* change(ui): fix cache
This commit is contained in:
Delirium 2023-01-23 16:38:06 +01:00 committed by GitHub
parent 43272a0197
commit 622a87e6b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 31 additions and 13 deletions

View file

@ -19,7 +19,7 @@ env:
CY_PASS: ${{ secrets.CYPRESS_PASSWORD }}
jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
name: Visual Testing
defaults:
run:
@ -35,6 +35,14 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v1
with:
path: frontend/node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: Setup env
run: |
echo "NODE_ENV=development" >> .env
@ -68,8 +76,9 @@ jobs:
run: npx wait-on http://0.0.0.0:3333
- name: (Chrome) Run visual tests
run: yarn cy:test
- name: (Firefox) Run visual tests
run: yarn cy:test-firefox
# firefox have different viewport somehow
# - name: (Firefox) Run visual tests
# run: yarn cy:test-firefox
- name: (Edge) Run visual tests
run: yarn cy:test-edge
- name: Upload Debug

View file

@ -88,7 +88,7 @@ function WebPlayer(props: any) {
contextValue.player.pause()
contextValue.player.scaleFullPage()
setTimeout(() => { contextValue.player.showClickmap(insights) }, 250)
}, 500)
}, 1500)
}
return () => {
isPlayerReady && contextValue.player.showClickmap(null)

View file

@ -54,7 +54,11 @@ export default class Animator {
private animationFrameRequestId: number = 0
constructor(private store: Store<GetState>, private mm: Moveable) {}
constructor(private store: Store<GetState>, private mm: Moveable) {
// @ts-ignore
window.playerJump = this.jump.bind(this)
}
private setTime(time: number) {
this.store.update({
@ -131,8 +135,8 @@ export default class Animator {
}
play() {
if (this.store.get().freeze) return;
if (!this.store.get().ready) {
if (this.store.get().freeze) return this.pause()
if (this.store.get().ready) {
cancelAnimationFrame(this.animationFrameRequestId)
this.store.update({ playing: true })
this.startAnimation()
@ -154,7 +158,7 @@ export default class Animator {
setTimeout(() => {
this.store.update({ freeze: true })
this.pause()
}, 1000)
}, 250)
} else {
setTimeout(() => this.freeze(), 500)
}

View file

@ -16,17 +16,22 @@ describe('Replayer visual match test', {
cy.get(':nth-child(2) > .relative > .p-2').type(Cypress.env('password').replaceAll("\"", ''))
cy.get('.justify-center > .h-10').click()
cy.wait('@getAccount')
cy.wait(2000)
cy.visit('3/session/7585361734083637?jumpto=5000&freeze=true')
cy.wait('@getFirstMob')
cy.wait('@getSecondMob')
cy.wait(5000)
cy.wait(2000)
cy.window().then(win => {
win.playerJump(5000)
})
cy.wait(4000)
cy.matchImageSnapshot('1st-breakpoint');
cy.visit('3/session/7585361734083637?jumpto=20000&freeze=true')
cy.wait('@getFirstMob')
cy.wait('@getSecondMob')
cy.wait(5000)
cy.window().then(win => {
win.playerJump(21000)
})
cy.wait(4000)
cy.matchImageSnapshot('2nd-breakpoint');

Binary file not shown.

Before

Width:  |  Height:  |  Size: 254 KiB

After

Width:  |  Height:  |  Size: 254 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 KiB

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 KiB

After

Width:  |  Height:  |  Size: 276 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 KiB

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

After

Width:  |  Height:  |  Size: 165 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 KiB

After

Width:  |  Height:  |  Size: 220 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 KiB

After

Width:  |  Height:  |  Size: 180 KiB