|
1 | | -// Copyright 2023-2024 The MathWorks, Inc. |
| 1 | +// Copyright 2023-2025 The MathWorks, Inc. |
2 | 2 |
|
3 | 3 | import { expect, test } from '@jupyterlab/galata'; |
4 | | -import { Locator } from '@playwright/test'; |
5 | 4 |
|
6 | 5 | test.describe('MATLAB File button', () => { |
7 | | - let MATLABFileButton: Locator; |
8 | | - test.beforeEach(async ({ page }) => { |
9 | | - await page.launcher.waitFor({ state: 'visible' }); |
10 | | - MATLABFileButton = page.getByText('MATLAB File', { exact: true }); |
11 | | - }); |
12 | | - |
13 | 6 | test('is visible on Launcher', async ({ page }) => { |
| 7 | + const MATLABFileButton = page.getByRole('button', { name: 'MATLAB File' }); |
14 | 8 | await expect(MATLABFileButton).toBeVisible(); |
15 | 9 | }); |
16 | 10 |
|
17 | 11 | test('takes you to .m file', async ({ page }) => { |
| 12 | + const MATLABFileButton = page.getByRole('button', { name: 'MATLAB File' }); |
18 | 13 | await MATLABFileButton.click(); |
19 | 14 |
|
20 | 15 | // Expect a new untitled file ending in .m to be made, with optional |
21 | 16 | // digits at the end of untitled, i.e. untitled1.m untitled1232.m) |
22 | | - await expect(page).toHaveURL(/.*untitled(\d+)?.m/); |
| 17 | + await page.waitForURL(/.*untitled(\d+)?.m/); |
23 | 18 |
|
24 | 19 | // MATLAB language mode selected: |
25 | 20 | await expect(page.locator('#jp-main-statusbar') |
|
0 commit comments