Comment out Vector, add back removed camera test code

This commit is contained in:
49lf
2024-12-13 13:37:44 -05:00
parent ac678feade
commit 42c378696d
3 changed files with 73 additions and 19 deletions

View File

@ -99,22 +99,22 @@ jobs:
run: | run: |
brew install gnu-sed brew install gnu-sed
echo "/opt/homebrew/opt/gnu-sed/libexec/gnubin" >> $GITHUB_PATH echo "/opt/homebrew/opt/gnu-sed/libexec/gnubin" >> $GITHUB_PATH
- name: Install vector # - name: Install vector
shell: bash # shell: bash
if: ${{ !startsWith(matrix.os, 'windows') }} # if: ${{ !startsWith(matrix.os, 'windows') }}
run: | # run: |
curl --proto '=https' --tlsv1.2 -sSfL https://sh.vector.dev > /tmp/vector.sh # curl --proto '=https' --tlsv1.2 -sSfL https://sh.vector.dev > /tmp/vector.sh
chmod +x /tmp/vector.sh # chmod +x /tmp/vector.sh
/tmp/vector.sh -y -no-modify-path # /tmp/vector.sh -y -no-modify-path
mkdir -p /tmp/vector # mkdir -p /tmp/vector
cp .github/workflows/vector.toml /tmp/vector.toml # cp .github/workflows/vector.toml /tmp/vector.toml
sed -i "s#GITHUB_WORKFLOW#${GITHUB_WORKFLOW}#g" /tmp/vector.toml # sed -i "s#GITHUB_WORKFLOW#${GITHUB_WORKFLOW}#g" /tmp/vector.toml
sed -i "s#GITHUB_REPOSITORY#${GITHUB_REPOSITORY}#g" /tmp/vector.toml # sed -i "s#GITHUB_REPOSITORY#${GITHUB_REPOSITORY}#g" /tmp/vector.toml
sed -i "s#GITHUB_SHA#${GITHUB_SHA}#g" /tmp/vector.toml # sed -i "s#GITHUB_SHA#${GITHUB_SHA}#g" /tmp/vector.toml
sed -i "s#GITHUB_REF_NAME#${GITHUB_REF_NAME}#g" /tmp/vector.toml # sed -i "s#GITHUB_REF_NAME#${GITHUB_REF_NAME}#g" /tmp/vector.toml
sed -i "s#GH_ACTIONS_AXIOM_TOKEN#${{secrets.GH_ACTIONS_AXIOM_TOKEN}}#g" /tmp/vector.toml # sed -i "s#GH_ACTIONS_AXIOM_TOKEN#${{secrets.GH_ACTIONS_AXIOM_TOKEN}}#g" /tmp/vector.toml
cat /tmp/vector.toml # cat /tmp/vector.toml
${HOME}/.vector/bin/vector --config /tmp/vector.toml & # ${HOME}/.vector/bin/vector --config /tmp/vector.toml &
- name: Build Wasm (because rust diff) - name: Build Wasm (because rust diff)
if: needs.check-rust-changes.outputs.rust-changed == 'true' if: needs.check-rust-changes.outputs.rust-changed == 'true'
shell: bash shell: bash

View File

@ -54,7 +54,10 @@ test.describe('Editor tests', () => {
|> close(%)`) |> close(%)`)
}) })
test('ensure we use the cache, and do not re-execute', async ({ homePage, page }) => { test('ensure we use the cache, and do not re-execute', async ({
homePage,
page,
}) => {
const u = await getUtils(page) const u = await getUtils(page)
await page.setBodyDimensions({ width: 1000, height: 500 }) await page.setBodyDimensions({ width: 1000, height: 500 })

View File

@ -408,9 +408,56 @@ test.describe('Testing Camera Movement', () => {
await u.waitForCmdReceive('default_camera_get_settings') await u.waitForCmdReceive('default_camera_get_settings')
}) })
await expect.poll(getCameraZValue, {
message: 'Camera should be at expected position after zooming',
})
await callback()
await page.mouse.move(orbitMouseEnd.x, orbitMouseEnd.y, {
steps: 3,
})
})
await test.step(`Verify orbit`, async () => {
await expect await expect
.poll(getCameraZValue, { .poll(getCameraZValue, {
message: 'Camera should be at expected position after zooming', message: 'Camera should be at expected position after orbiting',
})
.toEqual(expectedOrbitCamZPosition)
await page.mouse.up({ button: 'middle' })
})
// Helper functions
async function resetCamera() {
await test.step(`Reset camera`, async () => {
await u.openDebugPanel()
await u.clearCommandLogs()
await u.doAndWaitForCmd(async () => {
await gizmo.click({ button: 'right' })
await resetCameraButton.click()
}, 'zoom_to_fit')
await expect
.poll(getCameraZValue, {
message: 'Camera Z should be at expected position after reset',
})
.toEqual(expectedStartCamZPosition)
})
}
async function getCameraZValue() {
return page
.getByTestId('cam-z-position')
.inputValue()
.then((value) => parseFloat(value))
}
async function doOrbitWith(callback = async () => {}) {
await resetCamera()
await test.step(`Perform orbit`, async () => {
await page.mouse.move(orbitMouseStart.x, orbitMouseStart.y)
await page.mouse.down({ button: 'middle' })
await page.mouse.move(orbitMouseStepOne.x, orbitMouseStepOne.y, {
steps: 3,
}) })
await callback() await callback()
await page.mouse.move(orbitMouseEnd.x, orbitMouseEnd.y, { await page.mouse.move(orbitMouseEnd.x, orbitMouseEnd.y, {
@ -427,9 +474,13 @@ test.describe('Testing Camera Movement', () => {
await page.mouse.up({ button: 'middle' }) await page.mouse.up({ button: 'middle' })
}) })
} }
}) })
test('Right-click opens context menu when not dragged', async ({ homePage, page }) => { test('Right-click opens context menu when not dragged', async ({
homePage,
page,
}) => {
const u = await getUtils(page) const u = await getUtils(page)
await homePage.goToModelingScene() await homePage.goToModelingScene()
await u.waitForPageLoad() await u.waitForPageLoad()