generated from PrismarineJS/prismarine-template
-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prev-commit: 716ebcd
- Loading branch information
Showing
20 changed files
with
628 additions
and
335 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,16 +14,26 @@ jobs: | |
( | ||
contains(github.event.comment.body, '/deploy') | ||
) | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
ref: refs/pull/${{ github.event.issue.number }}/head | ||
- name: Install Global Dependencies | ||
run: npm install --global vercel pnpm | ||
- name: Pull Vercel Environment Information | ||
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} | ||
- name: Build Project Artifacts | ||
run: vercel build --token=${{ secrets.VERCEL_TOKEN }} | ||
- name: Deploy Project Artifacts to Vercel | ||
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} | ||
uses: mathiasvr/[email protected] | ||
with: | ||
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} | ||
id: deploy | ||
- uses: mshick/add-pr-comment@v2 | ||
with: | ||
message: | | ||
Deployed to Vercel Preview: ${{ steps.deploy.outputs.stdout }} |
Binary file modified
BIN
-36.9 KB
(86%)
cypress/integration/__image_snapshots__/superflat-world #0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,78 @@ | ||
/// <reference types="cypress" /> | ||
import type { AppOptions } from '../../src/optionsStorage' | ||
|
||
const setLocalStorageSettings = () => { | ||
const cleanVisit = () => { | ||
window.localStorage.clear() | ||
visit() | ||
} | ||
|
||
const visit = (url = '/') => { | ||
window.localStorage.cypress = 'true' | ||
window.localStorage.server = 'localhost' | ||
cy.visit(url) | ||
} | ||
|
||
// todo use ssl | ||
|
||
const compareRenderedFlatWorld = () => { | ||
// wait for render | ||
// cy.wait(6000) | ||
// cy.get('body').toMatchImageSnapshot({ | ||
// name: 'superflat-world', | ||
// }) | ||
} | ||
|
||
const testWorldLoad = () => { | ||
cy.document().then({ timeout: 20_000, }, doc => { | ||
return new Cypress.Promise(resolve => { | ||
doc.addEventListener('cypress-world-ready', resolve) | ||
}) | ||
}).then(() => { | ||
compareRenderedFlatWorld() | ||
}) | ||
} | ||
|
||
const setOptions = (options: Partial<AppOptions>) => { | ||
cy.window().then(win => { | ||
Object.assign(win['options'], options) | ||
}) | ||
} | ||
|
||
it('Loads & renders singleplayer', () => { | ||
cy.visit('/') | ||
window.localStorage.clear() | ||
window.localStorage.setItem('renderDistance', '2') | ||
window.localStorage.setItem('options', JSON.stringify({ | ||
cleanVisit() | ||
setOptions({ | ||
localServerOptions: { | ||
generation: { | ||
name: 'superflat', | ||
options: { seed: 250869072 } | ||
} | ||
} | ||
})) | ||
setLocalStorageSettings() | ||
cy.get('#title-screen').find('[data-test-id="singleplayer-button"]', { includeShadowDom: true, }).click() | ||
// todo implement load event | ||
cy.wait(12000) | ||
cy.get('body').toMatchImageSnapshot({ | ||
name: 'superflat-world', | ||
}, | ||
}, | ||
renderDistance: 2 | ||
}) | ||
cy.get('#title-screen').find('[data-test-id="singleplayer-button"]', { includeShadowDom: true, }).click() | ||
testWorldLoad() | ||
}) | ||
|
||
it('Joins to server', () => { | ||
cy.visit('/') | ||
setLocalStorageSettings() | ||
// visit('/?version=1.16.1') | ||
window.localStorage.version = '1.16.1' | ||
visit() | ||
// todo replace with data-test | ||
cy.get('#title-screen').find('[data-test-id="connect-screen-button"]', { includeShadowDom: true, }).click() | ||
cy.get('input#serverip', { includeShadowDom: true, }).clear().focus().type('localhost') | ||
cy.get('[data-test-id="connect-to-server"]', { includeShadowDom: true, }).click() | ||
// todo implement load event | ||
cy.wait(12000) | ||
cy.get('body').toMatchImageSnapshot({ | ||
name: 'superflat-world', | ||
}) | ||
testWorldLoad() | ||
}) | ||
|
||
it('Loads & renders zip world', () => { | ||
cy.visit('/') | ||
setLocalStorageSettings() | ||
cleanVisit() | ||
cy.get('#title-screen').find('[data-test-id="select-file-folder"]', { includeShadowDom: true, }).click({ shiftKey: true }) | ||
cy.get('input[type="file"]').selectFile('cypress/superflat.zip', { force: true }) | ||
// todo implement load event | ||
cy.wait(12000) | ||
cy.get('body').toMatchImageSnapshot({ | ||
name: 'superflat-world', | ||
}) | ||
testWorldLoad() | ||
}) | ||
|
||
it.skip('Performance test', () => { | ||
cy.visit('/') | ||
window.localStorage.cypress = 'true' | ||
window.localStorage.setItem('renderDistance', '6') | ||
cy.get('#title-screen').find('.menu > div:nth-child(2) > pmui-button:nth-child(1)', { includeShadowDom: true, }).selectFile('worlds') | ||
// -2 85 24 | ||
// select that world | ||
// from -2 85 24 | ||
// await bot.loadPlugin(pathfinder.pathfinder) | ||
// bot.pathfinder.goto(new pathfinder.goals.GoalXZ(28, -28)) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.