-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
37 changed files
with
477 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/** @file Tests for the asset panel. */ | ||
import * as test from '@playwright/test' | ||
import { expect, test } from '@playwright/test' | ||
|
||
import * as backend from '#/services/Backend' | ||
|
||
|
@@ -22,19 +22,18 @@ const EMAIL = '[email protected]' | |
// === Tests === | ||
// ============= | ||
|
||
test.test('open and close asset panel', ({ page }) => | ||
test('open and close asset panel', ({ page }) => | ||
actions | ||
.mockAllAndLogin({ page }) | ||
.withAssetPanel(async (assetPanel) => { | ||
await test.expect(assetPanel).toBeVisible() | ||
await expect(assetPanel).toBeVisible() | ||
}) | ||
.toggleAssetPanel() | ||
.withAssetPanel(async (assetPanel) => { | ||
await test.expect(assetPanel).not.toBeVisible() | ||
}), | ||
) | ||
await expect(assetPanel).not.toBeVisible() | ||
})) | ||
|
||
test.test('asset panel contents', ({ page }) => | ||
test('asset panel contents', ({ page }) => | ||
actions | ||
.mockAllAndLogin({ | ||
page, | ||
|
@@ -64,5 +63,21 @@ test.test('asset panel contents', ({ page }) => | |
// `getByText` is required so that this assertion works if there are multiple permissions. | ||
// This is not visible; "Shared with" should only be visible on the Enterprise plan. | ||
// await test.expect(actions.locateAssetPanelPermissions(page).getByText(USERNAME)).toBeVisible() | ||
}), | ||
) | ||
})) | ||
|
||
test('Asset Panel Documentation view', ({ page }) => { | ||
return actions | ||
.mockAllAndLogin({ | ||
page, | ||
setupAPI: (api) => { | ||
api.addProject('project', { description: DESCRIPTION }) | ||
}, | ||
}) | ||
.driveTable.clickRow(0) | ||
.toggleDocsAssetPanel() | ||
.withAssetPanel(async (assetPanel) => { | ||
await expect(assetPanel.getByTestId('asset-panel-tab-panel-docs')).toBeVisible() | ||
await expect(assetPanel.getByTestId('asset-docs-content')).toBeVisible() | ||
await expect(assetPanel.getByTestId('asset-docs-content')).toHaveText(/Project Goal/) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,15 @@ | ||
import { test as setup } from '@playwright/test' | ||
import { existsSync } from 'node:fs' | ||
import path from 'node:path' | ||
import * as actions from './actions' | ||
|
||
const __dirname = path.dirname(new URL(import.meta.url).pathname) | ||
const authFile = path.join(__dirname, '../../playwright/.auth/user.json') | ||
const isProd = process.env.NODE_ENV === 'production' | ||
|
||
const isFileExists = () => { | ||
if (isProd) { | ||
return false | ||
} | ||
|
||
return existsSync(authFile) | ||
} | ||
|
||
setup('authenticate', ({ page }) => { | ||
if (isFileExists()) { | ||
return setup.skip() | ||
} | ||
|
||
return actions | ||
setup('authenticate', ({ page }) => | ||
actions | ||
.mockAll({ page }) | ||
.login() | ||
.do(async () => { | ||
await page.context().storageState({ path: authFile }) | ||
}) | ||
}) | ||
}), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.