-
Notifications
You must be signed in to change notification settings - Fork 70
Expand file tree
/
Copy pathfile-menu.p.spec.ts
More file actions
65 lines (61 loc) · 2.48 KB
/
file-menu.p.spec.ts
File metadata and controls
65 lines (61 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
# Copyright 2022 Ball Aerospace & Technologies Corp.
# All Rights Reserved.
#
# This program is free software; you can modify and/or redistribute it
# under the terms of the GNU Affero General Public License
# as published by the Free Software Foundation; version 3 with
# attribution addendums as found in the LICENSE.txt
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# Modified by OpenC3, Inc.
# All changes Copyright 2025, OpenC3, Inc.
# All Rights Reserved
*/
// @ts-check
import { test, expect } from './../fixture'
test.use({
toolPath: '/tools/cmdtlmserver',
toolName: 'CmdTlmServer',
})
// Changing the polling rate is fraught with danger because it's all
// about waiting for changes and detecting changes. It mostly works
// but we skip it since it's fairly flaky.
test.skip('changes the polling rate', async ({ page, utils }) => {
await page.locator('[data-test=cmdtlmserver-file]').click()
await page.locator('[data-test=cmdtlmserver-file-options]').click()
await page.locator('.v-dialog input').fill('5000')
await page.locator('.v-dialog input').press('Enter')
await page.locator('.v-dialog').press('Escape')
await utils.sleep(1000)
let rxbytes = await page.$('tr:has-text("INST_INT") td >> nth=7')
const count1 = await rxbytes?.textContent()
await utils.sleep(2500)
expect(await rxbytes?.textContent()).toBe(count1)
await utils.sleep(2500)
// Now it's been more than 5s so it shouldn't match
expect(await rxbytes?.textContent()).not.toBe(count1)
// Set it back to 1000
await page.locator('[data-test=cmdtlmserver-file]').click()
await page.locator('[data-test=cmdtlmserver-file-options]').click()
await page.locator('.v-dialog input').fill('1000')
await page.locator('.v-dialog input').press('Enter')
await page.locator('.v-dialog').press('Escape')
})
test('stops posting to the api after closing', async ({ page, utils }) => {
let requestCount = 0
page.on('request', () => {
requestCount++
})
await utils.sleep(2000)
// Commenting out the next two lines causes the test to fail
await page.goto('/tools/tablemanager') // No API requests
await expect(page.locator('.v-app-bar')).toContainText('Table Manager')
const count = requestCount
await utils.sleep(2000) // Allow potential API requests to happen
expect(requestCount).toBe(count) // no change
})