Skip to content

Commit

Permalink
Fix playwright
Browse files Browse the repository at this point in the history
  • Loading branch information
jmthomas committed Nov 2, 2024
1 parent 50225f1 commit 7ecea39
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,11 @@ export default {
itemsPerPage: function () {
this.saveDefaultConfig(this.currentConfig)
},
pinnedItems: function () {
this.saveDefaultConfig(this.currentConfig)
pinnedItems: {
handler(_newVal, _oldVal) {
this.saveDefaultConfig(this.currentConfig)
},
deep: true, // Because pinnedItems is an array
},
},
computed: {
Expand Down Expand Up @@ -400,12 +403,6 @@ export default {
packet: this.packetName,
item: this.itemName,
})
this.rows = this.rows.map((row) => {
if (row.name === this.itemName) {
row.pinned = true
}
return row
})
},
})
}
Expand Down Expand Up @@ -577,8 +574,6 @@ export default {
}, this.refreshInterval)
},
resetConfig: function () {
this.targetName = ''
this.packetName = ''
this.refreshInterval = 1000
this.staleLimit = 30
this.showIgnored = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ export default {
}
},
created() {
// Look through the settings and see if we're a NAMED_WIDGET
this.settings.forEach((setting) => {
if (setting[0] === 'NAMED_WIDGET') {
setting[2].setNamedWidget(setting[1], this)
}
})
if (this.parameters[0]) {
this.label = this.parameters[0]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ export default {
}
},
created() {
// Look through the settings and see if we're a NAMED_WIDGET
this.settings.forEach((setting) => {
if (setting[0] === 'NAMED_WIDGET') {
setting[2].setNamedWidget(setting[1], this)
}
})
if (this.parameters[0]) {
this.label = this.parameters[0]
}
Expand Down
8 changes: 4 additions & 4 deletions playwright/tests/admin/plugins.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -562,10 +562,10 @@ test('deletes a plugin', async ({ page, utils }) => {
.click()
await expect(page.locator('.v-dialog')).toContainText('Confirm')
await page.locator('[data-test=confirm-dialog-delete]').click()
// await expect(page.locator('.v-dialog:has-text("Modified")')).toBeVisible()
// // Check the delete box
// await page.locator('text=DELETE MODIFIED').click()
// await page.locator('data-test=modified-plugin-submit').click()
await expect(page.locator('.v-dialog:has-text("Modified")')).toBeVisible()
// Check the delete box
await page.locator('text=DELETE MODIFIED').click()
await page.locator('data-test=modified-plugin-submit').click()

await expect(page.locator('[data-test=plugin-alert]')).toContainText(
'Removing plugin',
Expand Down
4 changes: 0 additions & 4 deletions playwright/tests/command-sender.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,6 @@ test('ignores normal range checks', async ({ page, utils }) => {
// Disable range checks
await page.locator('[data-test=command-sender-mode]').click()
await page.getByText('Ignore Range Checks').click()
await page.locator('[data-test=command-sender-mode]').click()
await page.locator('[data-test="select-send"]').click()
await expect(page.locator('main')).toContainText(
'cmd_no_range_check("INST COLLECT with TYPE \'NORMAL\', DURATION 1, OPCODE 171, TEMP 100") sent',
Expand All @@ -471,9 +470,6 @@ test('ignores normal range checks', async ({ page, utils }) => {
// Enable range checks
await page.locator('[data-test=command-sender-mode]').click()
await page.getByText('Ignore Range Checks').click()
await page.locator('[data-test=command-sender-mode]').click()
await utils.sleep(500) // menu closes

await utils.selectTargetPacketItem('EXAMPLE', 'START')
await page.locator('[data-test=sender-history]').click()
await utils.sleep(500) // Allow focus to change
Expand Down
20 changes: 10 additions & 10 deletions playwright/tests/packet-viewer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,33 +260,33 @@ test('pins items to the top of the list', async ({ page, utils }) => {
await page.getByText('PACKET_TIME *').click({
button: 'right',
})
await page.getByText('Pin Item').click()
await page.getByText('Pin Item', { exact: true }).click()
await expect(page.locator('tr').nth(1)).toContainText('PACKET_TIME *')
// Verify pin is not affected by sorting
await page.getByText('Name').click()
await page.getByText('Name', { exact: true }).click()
await expect(page.locator('tr').nth(1)).toContainText('PACKET_TIME *')
await page.getByText('Name').click()
await page.getByText('Name', { exact: true }).click()
await expect(page.locator('tr').nth(1)).toContainText('PACKET_TIME *')
await page.getByText('Name').click()
await page.getByText('Name', { exact: true }).click()
await expect(page.locator('tr').nth(1)).toContainText('PACKET_TIME *')
await page.getByText('Value').click()
await page.getByText('Value', { exact: true }).click()
await expect(page.locator('tr').nth(1)).toContainText('PACKET_TIME *')
await page.getByText('Value').click()
await page.getByText('Value', { exact: true }).click()
await expect(page.locator('tr').nth(1)).toContainText('PACKET_TIME *')
await page.getByText('Value').click()
await page.getByText('Value', { exact: true }).click()
await expect(page.locator('tr').nth(1)).toContainText('PACKET_TIME *')

await page.locator('[data-test="search"] input').fill('GROUND')
await expect(page.locator('tr').nth(1)).toContainText('PACKET_TIME *')
await page.getByText('GROUND1STATUS').click({
await page.getByText('GROUND1STATUS', { exact: true }).click({
button: 'right',
})
await page.getByText('Pin Item').click()
await page.getByText('Pin Item', { exact: true }).click()
await page.locator('[data-test="search"] input').fill('')
await expect(page.locator('tr').nth(1)).toContainText('GROUND1STATUS')

Check failure on line 286 in playwright/tests/packet-viewer.spec.ts

View workflow job for this annotation

GitHub Actions / openc3-build-test

[chromium] › packet-viewer.spec.ts:255:5 › pins items to the top of the list

1) [chromium] › packet-viewer.spec.ts:255:5 › pins items to the top of the list ────────────────── Error: Timed out 10000ms waiting for expect(locator).toContainText(expected) Locator: locator('tr').nth(1) Expected string: "GROUND1STATUS" Received string: " PACKET_TIME *" Call log: - expect.toContainText with timeout 10000ms - waiting for locator('tr').nth(1) - locator resolved to <tr class="v-data-table__tr">…</tr> - unexpected value " PACKET_TIME *" - locator resolved to <tr class="v-data-table__tr">…</tr> - unexpected value " PACKET_TIME *" - locator resolved to <tr class="v-data-table__tr">…</tr> - unexpected value " PACKET_TIME *" - locator resolved to <tr class="v-data-table__tr">…</tr> - unexpected value " PACKET_TIME *" - locator resolved to <tr class="v-data-table__tr">…</tr> - unexpected value " PACKET_TIME *" - locator resolved to <tr class="v-data-table__tr">…</tr> - unexpected value " PACKET_TIME *" - locator resolved to <tr class="v-data-table__tr">…</tr> - unexpected value " PACKET_TIME *" - locator resolved to <tr class="v-data-table__tr">…</tr> - unexpected value " PACKET_TIME *" - locator resolved to <tr class="v-data-table__tr">…</tr> - unexpected value " PACKET_TIME *" - locator resolved to <tr class="v-data-table__tr">…</tr> - unexpected value " PACKET_TIME *" - locator resolved to <tr class="v-data-table__tr">…</tr> - unexpected value " PACKET_TIME *" - locator resolved to <tr class="v-data-table__tr">…</tr> - unexpected value " PACKET_TIME *" - locator resolved to <tr class="v-data-table__tr">…</tr> - unexpected value " PACKET_TIME *" - locator resolved to <tr class="v-data-table__tr">…</tr> - unexpected value " PACKET_TIME *" 284 | await page.getByText('Pin Item', { exact: true }).click() 285 | await page.locator('[data-test="search"] input').fill('') > 286 | await expect(page.locator('tr').nth(1)).toContainText('GROUND1STATUS') | ^ 287 | await expect(page.locator('tr').nth(2)).toContainText('PACKET_TIME *') 288 | 289 | await page.getByText('GROUND1STATUS', { exact: true }).click({ at /home/runner/work/cosmos/cosmos/playwright/tests/packet-viewer.spec.ts:286:43

Check failure on line 286 in playwright/tests/packet-viewer.spec.ts

View workflow job for this annotation

GitHub Actions / openc3-build-test

[chromium] › packet-viewer.spec.ts:255:5 › pins items to the top of the list

1) [chromium] › packet-viewer.spec.ts:255:5 › pins items to the top of the list ────────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: Timed out 10000ms waiting for expect(locator).toContainText(expected) Locator: locator('tr').nth(1) Expected string: "GROUND1STATUS" Received string: " PACKET_TIME *" Call log: - expect.toContainText with timeout 10000ms - waiting for locator('tr').nth(1) - locator resolved to <tr class="v-data-table__tr">…</tr> - unexpected value " PACKET_TIME *" - locator resolved to <tr class="v-data-table__tr">…</tr> - unexpected value " PACKET_TIME *" - locator resolved to <tr class="v-data-table__tr">…</tr> - unexpected value " PACKET_TIME *" - locator resolved to <tr class="v-data-table__tr">…</tr> - unexpected value " PACKET_TIME *" - locator resolved to <tr class="v-data-table__tr">…</tr> - unexpected value " PACKET_TIME *" - locator resolved to <tr class="v-data-table__tr">…</tr> - unexpected value " PACKET_TIME *" - locator resolved to <tr class="v-data-table__tr">…</tr> - unexpected value " PACKET_TIME *" - locator resolved to <tr class="v-data-table__tr">…</tr> - unexpected value " PACKET_TIME *" - locator resolved to <tr class="v-data-table__tr">…</tr> - unexpected value " PACKET_TIME *" - locator resolved to <tr class="v-data-table__tr">…</tr> - unexpected value " PACKET_TIME *" - locator resolved to <tr class="v-data-table__tr">…</tr> - unexpected value " PACKET_TIME *" - locator resolved to <tr class="v-data-table__tr">…</tr> - unexpected value " PACKET_TIME *" - locator resolved to <tr class="v-data-table__tr">…</tr> - unexpected value " PACKET_TIME *" - locator resolved to <tr class="v-data-table__tr">…</tr> - unexpected value " PACKET_TIME *" 284 | await page.getByText('Pin Item', { exact: true }).click() 285 | await page.locator('[data-test="search"] input').fill('') > 286 | await expect(page.locator('tr').nth(1)).toContainText('GROUND1STATUS') | ^ 287 | await expect(page.locator('tr').nth(2)).toContainText('PACKET_TIME *') 288 | 289 | await page.getByText('GROUND1STATUS', { exact: true }).click({ at /home/runner/work/cosmos/cosmos/playwright/tests/packet-viewer.spec.ts:286:43
await expect(page.locator('tr').nth(2)).toContainText('PACKET_TIME *')

await page.getByText('GROUND1STATUS').click({
await page.getByText('GROUND1STATUS', { exact: true }).click({
button: 'right',
})
await page.getByText('Unpin Item').click()
Expand Down
11 changes: 7 additions & 4 deletions playwright/tests/script-runner/api.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,13 @@ test('test python metadata apis', async ({ page, utils }) => {
test('test python numpy import', async ({ page, utils }) => {
await openFile(page, utils, 'numpy.py')
await page.locator('[data-test=start-button]').click()
await expect(page.locator('[data-test=state]')).toHaveValue('Connecting...', {
timeout: 5000,
})
await expect(page.locator('[data-test=state]')).toHaveValue('stopped', {
await expect(page.locator('[data-test=state] input')).toHaveValue(
'Connecting...',
{
timeout: 5000,
},
)
await expect(page.locator('[data-test=state] input')).toHaveValue('stopped', {
timeout: 20000,
})
})
2 changes: 1 addition & 1 deletion playwright/tests/utc-time.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ test.describe('Telemetry Grapher UTC', () => {
await page.locator('text=Add Graph').click()
await utils.selectTargetPacketItem('INST', 'HEALTH_STATUS', 'TEMP1')
await page.locator('button:has-text("Add Item")').click()
await page.locator('.v-expansion-panel-header').click()
await page.locator('#innerapp button').first().click()
await utils.sleep(3000) // Wait for graphing to occur
// We can't check the canvas legend because its a canvas
await page.locator('#chart0 canvas').click({
Expand Down

0 comments on commit 7ecea39

Please sign in to comment.