Pass camera-movement.spec tests
This commit is contained in:
		@ -1,23 +1,14 @@
 | 
			
		||||
import { test, expect } from '@playwright/test'
 | 
			
		||||
import { test, expect } from './zoo-test'
 | 
			
		||||
import { EngineCommand } from 'lang/std/artifactGraph'
 | 
			
		||||
import { uuidv4 } from 'lib/utils'
 | 
			
		||||
import { getUtils, setup, tearDown } from './test-utils'
 | 
			
		||||
 | 
			
		||||
test.beforeEach(async ({ context, page }, testInfo) => {
 | 
			
		||||
  await setup(context, page, testInfo)
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
test.afterEach(async ({ page }, testInfo) => {
 | 
			
		||||
  await tearDown(page, testInfo)
 | 
			
		||||
})
 | 
			
		||||
import { getUtils,  } from './test-utils'
 | 
			
		||||
 | 
			
		||||
test.describe('Testing Camera Movement', () => {
 | 
			
		||||
  test('Can move camera reliably', async ({ page, context }) => {
 | 
			
		||||
    test.skip(process.platform === 'darwin', 'Can move camera reliably')
 | 
			
		||||
  test('Can move camera reliably', async ({ page, context, homePage }) => {
 | 
			
		||||
  const u = await getUtils(page)
 | 
			
		||||
    await page.setViewportSize({ width: 1200, height: 500 })
 | 
			
		||||
  await page.setBodyDimensions({ width: 1200, height: 500 })
 | 
			
		||||
  
 | 
			
		||||
    await u.waitForAuthSkipAppStart()
 | 
			
		||||
  await homePage.goToModelingScene()
 | 
			
		||||
  await u.openAndClearDebugPanel()
 | 
			
		||||
  await u.closeKclCodePanel()
 | 
			
		||||
  
 | 
			
		||||
@ -178,21 +169,17 @@ test.describe('Testing Camera Movement', () => {
 | 
			
		||||
  await bakeInRetries(async () => {
 | 
			
		||||
    await page.mouse.move(700, 400)
 | 
			
		||||
    await page.mouse.wheel(0, -100)
 | 
			
		||||
    }, [0, -85, -85])
 | 
			
		||||
  })
 | 
			
		||||
  }, [0, -85, -85]) })
 | 
			
		||||
 | 
			
		||||
  test('Zoom should be consistent when exiting or entering sketches', async ({
 | 
			
		||||
    page,
 | 
			
		||||
  }) => {
 | 
			
		||||
    // start new sketch pan and zoom before exiting, when exiting the sketch should stay in the same place
 | 
			
		||||
  test('Zoom should be consistent when exiting or entering sketches', async ({ page,  homePage }) => { // start new sketch pan and zoom before exiting, when exiting the sketch should stay in the same place
 | 
			
		||||
  // than zoom and pan outside of sketch mode and enter again and it should not change from where it is
 | 
			
		||||
  // than again for sketching
 | 
			
		||||
  
 | 
			
		||||
  test.skip(process.platform !== 'darwin', 'Zoom should be consistent')
 | 
			
		||||
  const u = await getUtils(page)
 | 
			
		||||
    await page.setViewportSize({ width: 1200, height: 500 })
 | 
			
		||||
  await page.setBodyDimensions({ width: 1200, height: 500 })
 | 
			
		||||
  
 | 
			
		||||
    await u.waitForAuthSkipAppStart()
 | 
			
		||||
  await homePage.goToModelingScene()
 | 
			
		||||
  await u.openDebugPanel()
 | 
			
		||||
  
 | 
			
		||||
  await expect(
 | 
			
		||||
@ -341,11 +328,9 @@ test.describe('Testing Camera Movement', () => {
 | 
			
		||||
  await page.mouse.move(855, y)
 | 
			
		||||
  await expect(page.getByTestId('hover-highlight').first()).toBeVisible({
 | 
			
		||||
    timeout: 10_000,
 | 
			
		||||
    })
 | 
			
		||||
  })
 | 
			
		||||
  }) })
 | 
			
		||||
 | 
			
		||||
  test(`Zoom by scroll should not fire while orbiting`, async ({ page }) => {
 | 
			
		||||
    /**
 | 
			
		||||
  test(`Zoom by scroll should not fire while orbiting`, async ({ page, homePage }) => { /**
 | 
			
		||||
   * Currently we only allow zooming by scroll when no other camera movement is happening,
 | 
			
		||||
   * set within cameraMouseDragGuards in cameraControls.ts,
 | 
			
		||||
   * until the engine supports unifying multiple camera movements.
 | 
			
		||||
@ -383,7 +368,7 @@ test.describe('Testing Camera Movement', () => {
 | 
			
		||||
  const expectedOrbitCamZPosition = 64.0
 | 
			
		||||
  
 | 
			
		||||
  await test.step(`Test setup`, async () => {
 | 
			
		||||
      await u.waitForAuthSkipAppStart()
 | 
			
		||||
    await homePage.goToModelingScene()
 | 
			
		||||
    await u.closeKclCodePanel()
 | 
			
		||||
    // This test requires the mouse controls to be set to Solidworks
 | 
			
		||||
    await u.openDebugPanel()
 | 
			
		||||
@ -477,6 +462,5 @@ test.describe('Testing Camera Movement', () => {
 | 
			
		||||
        .toEqual(expectedOrbitCamZPosition)
 | 
			
		||||
      await page.mouse.up({ button: 'middle' })
 | 
			
		||||
    })
 | 
			
		||||
    }
 | 
			
		||||
  })
 | 
			
		||||
  } })
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user