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
15
.github/workflows/ui-tests.js.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 254 KiB After Width: | Height: | Size: 254 KiB |
|
Before Width: | Height: | Size: 192 KiB After Width: | Height: | Size: 186 KiB |
|
Before Width: | Height: | Size: 280 KiB After Width: | Height: | Size: 276 KiB |
|
Before Width: | Height: | Size: 192 KiB After Width: | Height: | Size: 186 KiB |
|
Before Width: | Height: | Size: 170 KiB After Width: | Height: | Size: 165 KiB |
|
Before Width: | Height: | Size: 222 KiB After Width: | Height: | Size: 220 KiB |
|
Before Width: | Height: | Size: 184 KiB After Width: | Height: | Size: 180 KiB |