|
19 | 19 | import { expect as playExpect } from '@playwright/test'; |
20 | 20 | import type { Locator, Page } from '@playwright/test'; |
21 | 21 | import { AILabBasePage } from './ai-lab-base-page'; |
22 | | -import { StatusBar, handleConfirmationDialog, podmanAILabExtension, waitUntil } from '@podman-desktop/tests-playwright'; |
| 22 | +import { |
| 23 | + StatusBar, |
| 24 | + TasksPage, |
| 25 | + handleConfirmationDialog, |
| 26 | + podmanAILabExtension, |
| 27 | + waitUntil, |
| 28 | +} from '@podman-desktop/tests-playwright'; |
23 | 29 | import { AILabNavigationBar } from './ai-lab-navigation-bar'; |
24 | 30 |
|
25 | 31 | export class AILabStartRecipePage extends AILabBasePage { |
@@ -152,19 +158,10 @@ export class AILabStartRecipePage extends AILabBasePage { |
152 | 158 | const statusBar = new StatusBar(page); |
153 | 159 | await statusBar.tasksButton.click(); |
154 | 160 | console.log('Opened Tasks in status Bar'); |
155 | | - const tasksManager = this.page.getByTitle('Tasks Manager'); |
156 | | - await playExpect(tasksManager).toBeVisible(); |
157 | | - console.log('Finding particular task in task manager'); |
158 | | - const task = tasksManager.getByTitle(new RegExp(`Pulling ${appName}`)).locator('../..'); |
159 | | - console.log(`Content Text of task: ${await task.allInnerTexts()}`); |
160 | | - const viewButton = task.getByRole('button', { name: 'action button' }).and(task.getByText('View')); |
161 | | - await playExpect(viewButton).toBeVisible(); |
162 | | - await viewButton.click(); |
| 161 | + const tasksManager = new TasksPage(page); |
| 162 | + console.log('Finding particular task in task manager and switching to it'); |
| 163 | + await tasksManager.navigateToTask(`Pulling ${appName}`); |
163 | 164 | console.log('Start recipe page should be back'); |
164 | | - // we need to get rid of the task manager that is in the front now |
165 | | - const hideButton = tasksManager.getByRole('button').and(tasksManager.getByTitle('Hide')); |
166 | | - await playExpect(hideButton).toBeVisible(); |
167 | | - await hideButton.click(); |
168 | 165 | await playExpect(this.heading).toBeVisible(); |
169 | 166 | } |
170 | 167 | } |
0 commit comments