Skip to content

Commit

Permalink
Merge branch 'main' into nadro/3079/screenshot-improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
nadr0 committed Sep 20, 2024
2 parents 5f53ce7 + 5512f99 commit 26d79e3
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions e2e/playwright/testing-settings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,39 @@ test.describe('Testing settings', () => {
page,
}) => {
const u = await getUtils(page)
await page.setViewportSize({ width: 1200, height: 500 })
await u.waitForAuthSkipAppStart()
await page
.getByRole('button', { name: 'Start Sketch' })
.waitFor({ state: 'visible' })
await test.step(`Setup`, async () => {
await page.setViewportSize({ width: 1200, height: 500 })
await u.waitForAuthSkipAppStart()
await page
.getByRole('button', { name: 'Start Sketch' })
.waitFor({ state: 'visible' })
})

// Selectors and constants
const paneButtonLocator = page.getByTestId('debug-pane-button')
const headingLocator = page.getByRole('heading', {
name: 'Settings',
exact: true,
})
const inputLocator = page.locator('input[name="modeling-showDebugPanel"]')

// Open the settings modal with the browser keyboard shortcut
await page.keyboard.press('ControlOrMeta+Shift+,')
await test.step('Open settings dialog and set "Show debug panel" to on', async () => {
await page.keyboard.press('ControlOrMeta+Shift+,')
await expect(headingLocator).toBeVisible()

/** Test to close https://github.com/KittyCAD/modeling-app/issues/2713 */
await test.step(`Confirm that this dialog has a solid background`, async () => {
await expect
.poll(() => u.getGreatestPixDiff({ x: 600, y: 250 }, [28, 28, 28]), {
timeout: 1000,
message:
'Checking for solid background, should not see default plane colors',
})
.toBeLessThan(15)
})

await expect(headingLocator).toBeVisible()
await page.locator('#showDebugPanel').getByText('OffOn').click()
await page.locator('#showDebugPanel').getByText('OffOn').click()
})

// Close it and open again with keyboard shortcut, while KCL editor is focused
// Put the cursor in the editor
Expand Down

0 comments on commit 26d79e3

Please sign in to comment.