Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into lf94/tauri-to-electron
Browse files Browse the repository at this point in the history
  • Loading branch information
Irev-Dev committed Aug 15, 2024
2 parents 5f16505 + a7a88bd commit 4b54af7
Show file tree
Hide file tree
Showing 336 changed files with 2,488 additions and 251 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ Which commands from setup are one off vs need to be run every time?
The following will need to be run when checking out a new commit and guarantees the build is not stale:
```bash
yarn install
yarn wasm-prep
yarn build:wasm-dev # or yarn build:wasm for slower but more production-like build
yarn start # or yarn build:local && yarn serve for slower but more production-like build
```
Expand Down
2 changes: 1 addition & 1 deletion docs/kcl/abs.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/acos.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/angleToMatchLengthX.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/angleToMatchLengthY.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/angledLine.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/angledLineOfXLength.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/angledLineOfYLength.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/angledLineThatIntersects.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/angledLineToX.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/angledLineToY.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/arc.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/asin.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/assert.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/assertEqual.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/assertGreaterThan.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/assertGreaterThanOrEq.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/assertLessThan.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/assertLessThanOrEq.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/atan.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/bezierCurve.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/ceil.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/chamfer.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/kcl/circle.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/kcl/close.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/cos.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/e.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/kcl/extrude.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/kcl/fillet.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/floor.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/getNextAdjacentEdge.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/getOppositeEdge.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/getPreviousAdjacentEdge.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/helix.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/kcl/hole.md

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/kcl/import.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/int.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/lastSegX.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/lastSegY.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/kcl/line.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/lineTo.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/ln.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/log.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/log10.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/log2.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/max.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/min.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/patternCircular2d.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/patternCircular3d.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/patternLinear2d.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/patternLinear3d.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/patternTransform.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/pi.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/polar.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/pow.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/profileStart.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/profileStartX.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/profileStartY.md

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/kcl/revolve.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/segAng.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/segEndX.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/segEndY.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/segLen.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/kcl/shell.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/sin.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/sqrt.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/startProfileAt.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/startSketchAt.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions docs/kcl/startSketchOn.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/tan.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/tangentialArc.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/tangentialArcTo.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/tau.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/toDegrees.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/toRadians.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/xLine.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/xLineTo.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/yLine.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/kcl/yLineTo.md

Large diffs are not rendered by default.

Binary file modified e2e/playwright/export-snapshots/gltf-binary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/playwright/export-snapshots/gltf-embedded.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/playwright/export-snapshots/gltf-standard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/playwright/export-snapshots/obj-.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/playwright/export-snapshots/ply-ascii.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/playwright/export-snapshots/ply-binary_big_endian.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/playwright/export-snapshots/ply-binary_little_endian.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/playwright/export-snapshots/step-.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/playwright/export-snapshots/stl-ascii.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified e2e/playwright/export-snapshots/stl-binary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 29 additions & 50 deletions e2e/playwright/regression-tests.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test, expect } from '@playwright/test'
import { test, expect, Page } from '@playwright/test'

import { getUtils, setup, tearDown } from './test-utils'
import { TEST_CODE_TRIGGER_ENGINE_EXPORT_ERROR } from './storageStates'
Expand Down Expand Up @@ -346,55 +346,24 @@ const sketch001 = startSketchAt([-0, -0])
// expect zero errors in guter
await expect(page.locator('.cm-lint-marker-error')).not.toBeVisible()

// export the model
const exportButton = page.getByTestId('export-pane-button')
await expect(exportButton).toBeVisible()

// Click the export button
exportButton.click()

// Click the stl.
const stlOption = page.getByText('glTF')
await expect(stlOption).toBeVisible()

await page.keyboard.press('Enter')

// Click the checkbox
const submitButton = page.getByText('Confirm Export')
await expect(submitButton).toBeVisible()

await page.keyboard.press('Enter')

// Find the toast.
// Look out for the toast message
const exportingToastMessage = page.getByText(`Exporting...`)
await expect(exportingToastMessage).toBeVisible()

const errorToastMessage = page.getByText(`Error while exporting`)

const exportingToastMessage = page.getByText(`Exporting...`)
const engineErrorToastMessage = page.getByText(`Nothing to export`)

const alreadyExportingToastMessage = page.getByText(`Already exporting`)

// Try exporting again.
// Click the export button
exportButton.click()

// Click the stl.
await expect(stlOption).toBeVisible()

await page.keyboard.press('Enter')
await clickExportButton(page)

// Click the checkbox
await expect(submitButton).toBeVisible()
await expect(exportingToastMessage).toBeVisible()

await page.keyboard.press('Enter')
await clickExportButton(page)

// Find the toast.
// Look out for the toast message
await expect(exportingToastMessage).toBeVisible()
await expect(alreadyExportingToastMessage).toBeVisible()

await page.waitForTimeout(1000)

// Expect it to succeed.
await expect(exportingToastMessage).not.toBeVisible()
await expect(errorToastMessage).not.toBeVisible()
Expand All @@ -406,18 +375,7 @@ const sketch001 = startSketchAt([-0, -0])
await expect(alreadyExportingToastMessage).not.toBeVisible()

// Try exporting again.
// Click the export button
exportButton.click()

// Click the stl.
await expect(stlOption).toBeVisible()

await page.keyboard.press('Enter')

// Click the checkbox
await expect(submitButton).toBeVisible()

await page.keyboard.press('Enter')
await clickExportButton(page)

// Find the toast.
// Look out for the toast message
Expand All @@ -432,3 +390,24 @@ const sketch001 = startSketchAt([-0, -0])
await expect(successToastMessage).toBeVisible()
})
})

async function clickExportButton(page: Page) {
// export the model
const exportButton = page.getByTestId('export-pane-button')
await expect(exportButton).toBeVisible()

// Click the export button
exportButton.click()

// Click the stl.
const gltfOption = page.getByText('glTF')
await expect(gltfOption).toBeVisible()

await page.keyboard.press('Enter')

// Click the checkbox
const submitButton = page.getByText('Confirm Export')
await expect(submitButton).toBeVisible()

await page.keyboard.press('Enter')
}
13 changes: 11 additions & 2 deletions e2e/playwright/test-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ import pixelMatch from 'pixelmatch'
import { PNG } from 'pngjs'
import { Protocol } from 'playwright-core/types/protocol'
import type { Models } from '@kittycad/lib'
import { APP_NAME, TEST_SETTINGS_FILE_KEY } from 'lib/constants'
import waitOn from 'wait-on'
import { APP_NAME, COOKIE_NAME } from 'lib/constants'
import { secrets } from './secrets'
import { TEST_SETTINGS_KEY, TEST_SETTINGS } from './storageStates'
import * as TOML from '@iarna/toml'
Expand Down Expand Up @@ -650,6 +649,16 @@ export async function setup(context: BrowserContext, page: Page) {
} as Partial<SaveSettingsPayload>),
}
)

await context.addCookies([
{
name: COOKIE_NAME,
value: secrets.token,
path: '/',
domain: 'localhost',
secure: true,
},
])
// kill animations, speeds up tests and reduced flakiness
await page.emulateMedia({ reducedMotion: 'reduce' })
}
Expand Down
Loading

0 comments on commit 4b54af7

Please sign in to comment.