Pass can-sketch-on-all-planes... with ease
This commit is contained in:
		@ -139,9 +139,9 @@ async function doBasicSketch(page: Page, homePage: HomePageFixture, openPanes: s
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
test.describe('Basic sketch', () => {
 | 
			
		||||
  test('code pane open at start', { tag: ['@skipWin'] }, async ({ page, homePage }) => { // Skip on windows it is being weird.
 | 
			
		||||
  test.skip(process.platform === 'win32', 'Skip on windows')
 | 
			
		||||
  await doBasicSketch(page, homePage, ['code']) })
 | 
			
		||||
  test('code pane open at start', async ({ page, homePage }) => { // Skip on windows it is being weird.
 | 
			
		||||
    await doBasicSketch(page, homePage, ['code'])
 | 
			
		||||
  })
 | 
			
		||||
 | 
			
		||||
  test('code pane closed at start', async ({ page, homePage }) => { // Load the app with the code panes
 | 
			
		||||
  await page.addInitScript(async (persistModelingContext) => {
 | 
			
		||||
 | 
			
		||||
@ -1,27 +1,21 @@
 | 
			
		||||
import { test, expect } from '@playwright/test'
 | 
			
		||||
import { getUtils, setup, tearDown } from './test-utils'
 | 
			
		||||
import { test, expect, Page } from './zoo-test'
 | 
			
		||||
import { HomePageFixture } from './fixtures/HomePageFixture'
 | 
			
		||||
import { getUtils } from './test-utils'
 | 
			
		||||
import { EngineCommand } from 'lang/std/artifactGraph'
 | 
			
		||||
import { uuidv4 } from 'lib/utils'
 | 
			
		||||
 | 
			
		||||
test.beforeEach(async ({ context, page }, testInfo) => {
 | 
			
		||||
  await setup(context, page, testInfo)
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
test.afterEach(async ({ page }, testInfo) => {
 | 
			
		||||
  await tearDown(page, testInfo)
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
test.describe('Can create sketches on all planes and their back sides', () => {
 | 
			
		||||
  const sketchOnPlaneAndBackSideTest = async (
 | 
			
		||||
    page: any,
 | 
			
		||||
    page: Page,
 | 
			
		||||
    homePage: HomePageFixture,
 | 
			
		||||
    plane: string,
 | 
			
		||||
    clickCoords: { x: number; y: number }
 | 
			
		||||
  ) => {
 | 
			
		||||
    const u = await getUtils(page)
 | 
			
		||||
    const PUR = 400 / 37.5 //pixeltoUnitRatio
 | 
			
		||||
    await page.setViewportSize({ width: 1200, height: 500 })
 | 
			
		||||
    await page.setBodyDimensions({ width: 1200, height: 500 })
 | 
			
		||||
 | 
			
		||||
    await u.waitForAuthSkipAppStart()
 | 
			
		||||
    await homePage.goToModelingScene()
 | 
			
		||||
    await u.openDebugPanel()
 | 
			
		||||
 | 
			
		||||
    const coord =
 | 
			
		||||
@ -83,32 +77,32 @@ test.describe('Can create sketches on all planes and their back sides', () => {
 | 
			
		||||
    await u.clearCommandLogs()
 | 
			
		||||
    await u.removeCurrentCode()
 | 
			
		||||
  }
 | 
			
		||||
  test('XY', async ({ page }) => {
 | 
			
		||||
  test('XY', async ({ page, homePage }) => {
 | 
			
		||||
    await sketchOnPlaneAndBackSideTest(
 | 
			
		||||
      page,
 | 
			
		||||
      'XY',
 | 
			
		||||
      { x: 600, y: 388 } // red plane
 | 
			
		||||
      // { x: 600, y: 400 }, // red plane // clicks grid helper and that causes problems, should fix so that these coords work too.
 | 
			
		||||
    )
 | 
			
		||||
    page,
 | 
			
		||||
    homePage,
 | 
			
		||||
    'XY',
 | 
			
		||||
    { x: 600, y: 388 } // red plane
 | 
			
		||||
    // { x: 600, y: 400 }, // red plane // clicks grid helper and that causes problems, should fix so that these coords work too.
 | 
			
		||||
  ) })
 | 
			
		||||
 | 
			
		||||
  test('YZ', async ({ page, homePage }) => {
 | 
			
		||||
    await sketchOnPlaneAndBackSideTest(page, homePage, 'YZ', { x: 700, y: 250 }) // green plane
 | 
			
		||||
  })
 | 
			
		||||
 | 
			
		||||
  test('YZ', async ({ page }) => {
 | 
			
		||||
    await sketchOnPlaneAndBackSideTest(page, 'YZ', { x: 700, y: 250 }) // green plane
 | 
			
		||||
  test('XZ', async ({ page, homePage }) => {
 | 
			
		||||
    await sketchOnPlaneAndBackSideTest(page, homePage, '-XZ', { x: 700, y: 80 }) // blue plane
 | 
			
		||||
  })
 | 
			
		||||
 | 
			
		||||
  test('XZ', async ({ page }) => {
 | 
			
		||||
    await sketchOnPlaneAndBackSideTest(page, '-XZ', { x: 700, y: 80 }) // blue plane
 | 
			
		||||
  test('-XY', async ({ page, homePage }) => {
 | 
			
		||||
    await sketchOnPlaneAndBackSideTest(page, homePage, '-XY', { x: 600, y: 118 }) // back of red plane
 | 
			
		||||
  })
 | 
			
		||||
 | 
			
		||||
  test('-XY', async ({ page }) => {
 | 
			
		||||
    await sketchOnPlaneAndBackSideTest(page, '-XY', { x: 600, y: 118 }) // back of red plane
 | 
			
		||||
  test('-YZ', async ({ page, homePage }) => {
 | 
			
		||||
    await sketchOnPlaneAndBackSideTest(page, homePage, '-YZ', { x: 700, y: 219 }) // back of green plan
 | 
			
		||||
  })
 | 
			
		||||
 | 
			
		||||
  test('-YZ', async ({ page }) => {
 | 
			
		||||
    await sketchOnPlaneAndBackSideTest(page, '-YZ', { x: 700, y: 219 }) // back of green plane
 | 
			
		||||
  })
 | 
			
		||||
 | 
			
		||||
  test('-XZ', async ({ page }) => {
 | 
			
		||||
    await sketchOnPlaneAndBackSideTest(page, 'XZ', { x: 700, y: 427 }) // back of blue plane
 | 
			
		||||
  test('-XZ', async ({ page, homePage }) => {
 | 
			
		||||
    await sketchOnPlaneAndBackSideTest(page, homePage, 'XZ', { x: 700, y: 427 }) // back of blue plane
 | 
			
		||||
  })
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user