Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/build-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ on:
- 'v[0-9]+.[0-9]+.[0-9]+'

env:
IS_RELEASE: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }}
IS_RELEASE: true
# IS_RELEASE: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }}
IS_STAGING: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}

concurrency:
Expand Down Expand Up @@ -103,7 +104,8 @@ jobs:
- name: Set release version
if: ${{ env.IS_RELEASE == 'true' }}
run: |
export VERSION=${GITHUB_REF_NAME#v}
# export VERSION=${GITHUB_REF_NAME#v}
export VERSION=0.0.0
npm run files:set-version

- uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -215,6 +217,7 @@ jobs:
CSC_LINK: ${{ secrets.APPLE_CERTIFICATE }}
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
CSC_KEYCHAIN: ${{ secrets.APPLE_SIGNING_IDENTITY }}
CSC_FOR_PULL_REQUEST: true
WINDOWS_CERTIFICATE_THUMBPRINT: ${{ secrets.WINDOWS_CERTIFICATE_THUMBPRINT }}
run: npm run tronb:package:${{ env.IS_STAGING == 'true' && 'dev' || 'prod' }}

Expand Down
2 changes: 1 addition & 1 deletion e2e/playwright/command-bar-tests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ theta = 45deg
await homePage.textToCadBtn.click()
await cmdBar.expectState({
stage: 'arguments',
commandName: 'Text-to-CAD Create',
commandName: 'Create Project using Text-to-CAD',
currentArgKey: 'prompt',
currentArgValue: '',
headerArguments: {
Expand Down
17 changes: 7 additions & 10 deletions e2e/playwright/fixtures/cmdBarFixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,9 @@ export class CmdBarFixture {
await submitButton.click()
}

openCmdBar = async (selectCmd?: 'promptToEdit') => {
openCmdBar = async () => {
await this.cmdBarOpenBtn.click()
await expect(this.page.getByPlaceholder('Search commands')).toBeVisible()
if (selectCmd === 'promptToEdit') {
const promptEditCommand = this.selectOption({ name: 'Text-to-CAD Edit' })
await expect(promptEditCommand.first()).toBeVisible()
await promptEditCommand.first().scrollIntoViewIfNeeded()
await promptEditCommand.first().click()
}
}

closeCmdBar = async () => {
Expand Down Expand Up @@ -267,15 +261,18 @@ export class CmdBarFixture {
if (part.startsWith('--')) continue

const nameMatch = part.match(/name="([^"]+)"/)
if (!nameMatch) continue
if (!nameMatch) {
console.log('No name match found in part:', part.substring(0, 100))
continue
}

const name = nameMatch[1]
const content = part.split(/\r?\n\r?\n/)[1]?.trim()
if (!content) continue

if (name === 'event') {
if (name === 'body') {
eventData = JSON.parse(content)
} else {
} else if (name === 'files') {
files[name] = content
}
}
Expand Down
4 changes: 2 additions & 2 deletions e2e/playwright/fixtures/editorFixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export class EditorFixture {
await this.scrollToBottom()
if (!shouldNormalise) {
const result = not
? await expect(this.codeContent).not.toContainText(code)
: await expect(this.codeContent).toContainText(code)
? await expect(this.codeContent).not.toContainText(code, { timeout })
: await expect(this.codeContent).toContainText(code, { timeout })

await resetPane()
return result
Expand Down
2 changes: 1 addition & 1 deletion e2e/playwright/fixtures/fixtureSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export class ElectronZoo {
}

if (!this.firstUrl) {
await this.page.getByRole('heading', { name: 'Projects' }).count()
await this.page.getByRole('tab', { name: 'Projects' }).count()
this.firstUrl = this.page.url()
}

Expand Down
4 changes: 1 addition & 3 deletions e2e/playwright/fixtures/homePageFixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ export class HomePageFixture {

expectIsCurrentPage = async () => {
await expect(this.page).toHaveURL(/.*home/)
await expect(
this.page.getByRole('heading', { name: 'Projects' })
).toBeVisible()
await expect(this.page.getByRole('tab', { name: 'Projects' })).toBeVisible()
}

projectsLoaded = async () => {
Expand Down
9 changes: 9 additions & 0 deletions e2e/playwright/fixtures/toolbarFixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,4 +326,13 @@ export class ToolbarFixture {
await expect(goToDefinitionMenuButton).toBeVisible()
await goToDefinitionMenuButton.click()
}

async fireTtcPrompt(prompt: string) {
await this.openPane('text-to-cad')
await expect(
this.page.getByTestId('ml-ephant-conversation-input')
).toBeVisible()
await this.page.getByTestId('ml-ephant-conversation-input').fill(prompt)
await this.page.getByTestId('ml-ephant-conversation-input-button').click()
}
}
20 changes: 1 addition & 19 deletions e2e/playwright/native-file-menu.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,6 @@ test.describe(
)
await openSettingsExpectLocator(page, '#themeColor')
})
await test.step('Modeling.Edit.Modify with Zoo Text-To-CAD', async () => {
await page.waitForTimeout(250)
await clickElectronNativeMenuById(
tronApp,
'Edit.Modify with Zoo Text-To-CAD'
)
await cmdBar.expectCommandName('Text-to-CAD Edit')
})
await test.step('Modeling.Edit.Edit parameter', async () => {
await page.waitForTimeout(250)
await clickElectronNativeMenuById(tronApp, 'Edit.Edit parameter')
Expand Down Expand Up @@ -518,17 +510,7 @@ test.describe(
'Design.Create with Zoo Text-To-CAD'
)
await cmdBar.toBeOpened()
await cmdBar.expectCommandName('Text-to-CAD Create')
})

await test.step('Modeling.Design.Modify with Zoo Text-To-CAD', async () => {
await page.waitForTimeout(250)
await clickElectronNativeMenuById(
tronApp,
'Design.Modify with Zoo Text-To-CAD'
)
await cmdBar.toBeOpened()
await cmdBar.expectCommandName('Text-to-CAD Edit')
await cmdBar.expectCommandName('Create Project using Text-to-CAD')
})

await test.step('Modeling.Help.KCL code samples', async () => {
Expand Down
18 changes: 9 additions & 9 deletions e2e/playwright/projects.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ test.describe(`Project management commands`, () => {
const projectNameOption = page.getByRole('option', { name: projectName })
const commandWarning = page.getByText('Are you sure you want to delete?')
const toastMessage = page.getByText(`Successfully deleted`)
const noProjectsMessage = page.getByText('No projects found')
const noProjectsMessage = page.getByText('No results found')

await test.step(`Setup`, async () => {
await page.setBodyDimensions({ width: 1200, height: 500 })
Expand Down Expand Up @@ -758,7 +758,7 @@ test.describe(`Project management commands`, () => {
const projectNameOption = page.getByRole('option', { name: projectName })
const commandWarning = page.getByText('Are you sure you want to delete?')
const toastMessage = page.getByText(`Successfully deleted`)
const noProjectsMessage = page.getByText('No projects found')
const noProjectsMessage = page.getByText('No results found')

await test.step(`Setup`, async () => {
await page.setBodyDimensions({ width: 1200, height: 500 })
Expand Down Expand Up @@ -1042,7 +1042,7 @@ test(
})

await test.step('Check that the home page is empty', async () => {
await expect(page.getByText('No projects found')).toBeVisible()
await expect(page.getByText('No results found')).toBeVisible()
})

await test.step('Check we can still create a project', async () => {
Expand Down Expand Up @@ -1120,7 +1120,7 @@ test(

await test.step('should be shorted by modified initially', async () => {
const lastModifiedButton = page.getByRole('button', {
name: 'Last Modified',
name: 'Age',
})
await expect(lastModifiedButton).toBeVisible()
await expect(lastModifiedButton.getByLabel('arrow down')).toBeVisible()
Expand All @@ -1141,7 +1141,7 @@ test(

await test.step('Reverse modified order', async () => {
const lastModifiedButton = page.getByRole('button', {
name: 'Last Modified',
name: 'Age',
})
await lastModifiedButton.click()
await expect(lastModifiedButton).toBeVisible()
Expand Down Expand Up @@ -1217,8 +1217,8 @@ test(
// Constants and locators
const projectLinks = page.getByTestId('project-link')

// expect to see text "No projects found"
await expect(page.getByText('No projects found')).toBeVisible()
// expect to see text "No results found"
await expect(page.getByText('No results found')).toBeVisible()

await createProject({ name: 'project-000', page, returnHome: true })
await expect(projectLinks.getByText('project-000')).toBeVisible()
Expand Down Expand Up @@ -1365,7 +1365,7 @@ test(

await homePage.projectsLoaded()

await expect(page.getByText('No projects found')).toBeVisible()
await expect(page.getByText('No results found')).toBeVisible()
await createProject({ name: 'project-000', page, returnHome: true })
await expect(
page.getByTestId('project-link').filter({ hasText: 'project-000' })
Expand Down Expand Up @@ -1432,7 +1432,7 @@ test(
page.on('console', console.log)

// Our locator constants
const searchInput = page.getByPlaceholder('Search projects')
const searchInput = page.getByPlaceholder('Search')
const projectLinks = page.getByTestId('project-link')

await test.step('Search for "basi"', async () => {
Expand Down
14 changes: 3 additions & 11 deletions e2e/playwright/prompt-to-edit-snapshot-tests.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect, test } from '@e2e/playwright/zoo-test'
import { test } from '@e2e/playwright/zoo-test'
import path from 'path'
import fsp from 'fs/promises'

Expand Down Expand Up @@ -64,7 +64,7 @@ test.describe('edit with AI example snapshots', () => {
`change colour`,
// TODO this is more of a snapshot, but atm it needs to be manually run locally to update the files
{ tag: ['@desktop'] },
async ({ context, homePage, cmdBar, editor, page, scene }) => {
async ({ context, homePage, cmdBar, editor, page, scene, toolbar }) => {
const project = 'test-dir'
await context.folderSetupFn(async (dir) => {
const projectDir = path.join(dir, project)
Expand All @@ -85,7 +85,6 @@ test.describe('edit with AI example snapshots', () => {
body1CapCoords.x,
body1CapCoords.y
)
const submittingToast = page.getByText('Submitting to Text-to-CAD API...')

await test.step('wait for scene to load select body and check selection came through', async () => {
await clickBody1Cap()
Expand All @@ -98,16 +97,9 @@ test.describe('edit with AI example snapshots', () => {

await test.step('fire off edit prompt', async () => {
await cmdBar.captureTextToCadRequestSnapshot(test.info())
await cmdBar.openCmdBar('promptToEdit')
await toolbar.fireTtcPrompt('make this neon green please, use #39FF14')
await page.waitForTimeout(100)
await cmdBar.progressCmdBar()
// being specific about the color with a hex means asserting pixel color is more stable
await page
.getByTestId('cmd-bar-arg-value')
.fill('make this neon green please, use #39FF14')
await page.waitForTimeout(100)
await cmdBar.progressCmdBar()
await expect(submittingToast).toBeVisible()
})
}
)
Expand Down
Loading
Loading