|
|
|
@ -135,35 +135,34 @@ export class ProjectsPage extends BasePage {
|
|
|
|
|
if (!withoutPrefix) title = this.prefixTitle(title); |
|
|
|
|
|
|
|
|
|
let project: any; |
|
|
|
|
|
|
|
|
|
const openProjectUiAction = this.get() |
|
|
|
|
|
|
|
|
|
const responsePromise = this.rootPage.waitForResponse(async res => { |
|
|
|
|
let json: any = {}; |
|
|
|
|
try { |
|
|
|
|
json = await res.json(); |
|
|
|
|
} catch (e) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const isRequiredResponse = |
|
|
|
|
res.request().url().includes('/api/v1/db/meta/projects') && |
|
|
|
|
['GET'].includes(res.request().method()) && |
|
|
|
|
json?.title === title; |
|
|
|
|
|
|
|
|
|
if (isRequiredResponse) { |
|
|
|
|
project = json; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return isRequiredResponse; |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
await this.get() |
|
|
|
|
.locator(`.ant-table-cell`, { |
|
|
|
|
hasText: title, |
|
|
|
|
}) |
|
|
|
|
.click(); |
|
|
|
|
|
|
|
|
|
await Promise.all([ |
|
|
|
|
this.rootPage.waitForResponse(async res => { |
|
|
|
|
let json: any = {}; |
|
|
|
|
try { |
|
|
|
|
json = await res.json(); |
|
|
|
|
} catch (e) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const isRequiredResponse = |
|
|
|
|
res.request().url().includes('/api/v1/db/meta/projects') && |
|
|
|
|
['GET'].includes(res.request().method()) && |
|
|
|
|
json?.title === title; |
|
|
|
|
|
|
|
|
|
if (isRequiredResponse) { |
|
|
|
|
project = json; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return isRequiredResponse; |
|
|
|
|
}), |
|
|
|
|
openProjectUiAction, |
|
|
|
|
]); |
|
|
|
|
await responsePromise |
|
|
|
|
|
|
|
|
|
const dashboard = new DashboardPage(this.rootPage, project); |
|
|
|
|
|
|
|
|
|