From 8833a472e9ac170576511707c1679a73daf96c1a Mon Sep 17 00:00:00 2001 From: Alex Velichko Date: Tue, 21 Nov 2023 00:05:34 +0300 Subject: [PATCH 1/6] feat(tests): TESTS-85 added issues.spec.ts test Signed-off-by: Alex Velichko --- .github/workflows/main.yml | 7 ++ tests/create-local.sh | 4 + tests/prepare.sh | 3 + tests/restore-workspace.sh | 1 + tests/sanity/.env | 1 + .../sanity/tests/collaborative/issues.spec.ts | 77 +++++++++++++++++++ tests/sanity/tests/playwright.config.ts | 8 +- tests/sanity/tests/utils.ts | 1 + 8 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 tests/sanity/tests/collaborative/issues.spec.ts diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a6004e90e57..14ac8fd77e8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -198,6 +198,13 @@ jobs: with: name: playwright-results path: ./tests/sanity/playwright-report/ + - name: Get Allure history + uses: actions/checkout@v2 + if: ${{ github.ref == 'refs/heads/main' }} + continue-on-error: true + with: + ref: gh-pages + path: gh-pages - name: Generates Allure Report uses: simple-elf/allure-report-action@master if: always() diff --git a/tests/create-local.sh b/tests/create-local.sh index ce7f5e12f71..a891cbd12b8 100755 --- a/tests/create-local.sh +++ b/tests/create-local.sh @@ -12,6 +12,9 @@ node ../dev/tool/bundle.js create-workspace sanity-ws -o SanityTest # Create user record in accounts node ../dev/tool/bundle.js create-account user1 -f John -l Appleseed -p 1234 node ../dev/tool/bundle.js confirm-email user1 +# Create second user record in accounts +node ../dev/tool/bundle.js create-account user2 -f Kainin -l Numoin -p 1234 +node ../dev/tool/bundle.js confirm-email user2 # Restore workspace contents in mongo/elastic @@ -21,6 +24,7 @@ node ../dev/tool/bundle.js upgrade-workspace sanity-ws # Re-assign user to workspace. node ../dev/tool/bundle.js assign-workspace user1 sanity-ws +node ../dev/tool/bundle.js assign-workspace user2 sanity-ws node ../dev/tool/bundle.js configure sanity-ws --enable=* node ../dev/tool/bundle.js configure sanity-ws --list \ No newline at end of file diff --git a/tests/prepare.sh b/tests/prepare.sh index 3a45d3407e2..a7be6b59f74 100755 --- a/tests/prepare.sh +++ b/tests/prepare.sh @@ -10,8 +10,11 @@ docker-compose -p sanity up -d --force-recreate --renew-anon-volumes ./tool.sh create-workspace sanity-ws -o SanityTest # Create user record in accounts ./tool.sh create-account user1 -f John -l Appleseed -p 1234 +./tool.sh create-account user2 -f Kainin -l Dirak -p 1234 # Make user the workspace maintainer ./tool.sh set-user-role user1 sanity-ws 1 ./tool.sh confirm-email user1 +./tool.sh set-user-role user2 sanity-ws 1 +./tool.sh confirm-email user2 ./restore-workspace.sh \ No newline at end of file diff --git a/tests/restore-workspace.sh b/tests/restore-workspace.sh index e2853e17f81..f20bc59c982 100755 --- a/tests/restore-workspace.sh +++ b/tests/restore-workspace.sh @@ -7,6 +7,7 @@ # Re-assign user to workspace. ./tool.sh assign-workspace user1 sanity-ws +./tool.sh assign-workspace user2 sanity-ws ./tool.sh configure sanity-ws --enable=* ./tool.sh configure sanity-ws --list diff --git a/tests/sanity/.env b/tests/sanity/.env index d21f4d68769..210ce416f65 100644 --- a/tests/sanity/.env +++ b/tests/sanity/.env @@ -1,5 +1,6 @@ PLATFORM_URI='http://localhost:8083' PLATFORM_TRANSACTOR='ws://localhost:3334' PLATFORM_USER='user1' +PLATFORM_USER_SECOND='user2' PLATFORM_TOKEN='eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6InVzZXIxIiwid29ya3NwYWNlIjoic2FuaXR5LXdzIn0.hfUCqePHO-WNps2by4B-CYGKIpDpLG0WVCUUtU-SVI4' SETTING=storage.json \ No newline at end of file diff --git a/tests/sanity/tests/collaborative/issues.spec.ts b/tests/sanity/tests/collaborative/issues.spec.ts new file mode 100644 index 00000000000..adc05c0092d --- /dev/null +++ b/tests/sanity/tests/collaborative/issues.spec.ts @@ -0,0 +1,77 @@ +import { test } from '@playwright/test' +import { generateId, PlatformURI, PlatformUser, PlatformUserSecond } from '../utils' +import { SelectWorkspacePage } from '../model/select-workspace-page' +import { allure } from 'allure-playwright' +import { LoginPage } from '../model/login-page' +import { NewIssue } from '../model/tracker/types' +import { IssuesPage } from '../model/tracker/issues-page' +import { LeftSideMenuPage } from '../model/left-side-menu-page' +import { IssuesDetailsPage } from '../model/tracker/issues-details-page' + +test.describe('Collaborative test for issue', () => { + test.beforeEach(async ({ page }) => { + await allure.parentSuite('Collaborative test') + await (await page.goto(`${PlatformURI}/workbench/sanity-ws/tracker/`))?.finished() + }) + + test('Issues can be assigned to another users', async ({ browser }) => { + const userFirstContext = await browser.newContext() + const userSecondContext = await browser.newContext() + + const userFirstPage = await userFirstContext.newPage() + const userSecondPage = await userSecondContext.newPage() + + // create issue + const loginPage = new LoginPage(userFirstPage) + await loginPage.goto() + await loginPage.login(PlatformUser, '1234') + + const selectWorkspacePage = new SelectWorkspacePage(userFirstPage) + await selectWorkspacePage.selectWorkspace('sanity-ws') + + const newIssue: NewIssue = { + title: `Collaborative test for issue-${generateId()}`, + description: 'Collaborative test for issue', + status: 'Backlog', + priority: 'Urgent', + assignee: 'Appleseed John', + createLabel: true, + labels: `CREATE-ISSUE-${generateId()}`, + component: 'No component', + estimation: '2', + milestone: 'No Milestone', + duedate: 'today', + filePath: 'cat.jpeg' + } + + const leftSideMenuPage = new LeftSideMenuPage(userFirstPage) + await leftSideMenuPage.buttonTracker.click() + + const issuesPage = new IssuesPage(userFirstPage) + await issuesPage.modelSelectorAll.click() + await issuesPage.createNewIssue(newIssue) + + // check by another user + const loginPageSecond = new LoginPage(userSecondPage) + await loginPageSecond.goto() + await loginPageSecond.login(PlatformUserSecond, '1234') + + const selectWorkspacePageSecond = new SelectWorkspacePage(userSecondPage) + await selectWorkspacePageSecond.selectWorkspace('sanity-ws') + + const leftSideMenuPageSecond = new LeftSideMenuPage(userSecondPage) + await leftSideMenuPageSecond.buttonTracker.click() + + const issuesPageSecond = new IssuesPage(userSecondPage) + await issuesPageSecond.modelSelectorAll.click() + await issuesPageSecond.searchIssueByName(newIssue.title) + await issuesPageSecond.openIssueByName(newIssue.title) + + const issuesDetailsPageSecond = new IssuesDetailsPage(userSecondPage) + await issuesDetailsPageSecond.checkIssue({ + ...newIssue, + milestone: 'Milestone', + estimation: '2h' + }) + }) +}) diff --git a/tests/sanity/tests/playwright.config.ts b/tests/sanity/tests/playwright.config.ts index 97b3c7e13de..5a20e7448f7 100644 --- a/tests/sanity/tests/playwright.config.ts +++ b/tests/sanity/tests/playwright.config.ts @@ -1,8 +1,14 @@ -import { PlaywrightTestConfig } from '@playwright/test' +import { devices, PlaywrightTestConfig } from '@playwright/test' import { config as dotenvConfig } from 'dotenv' dotenvConfig() const config: PlaywrightTestConfig = { + projects: [ + { + name: 'Tests', + use: { ...devices['Desktop Chrome'] } + } + ], use: { screenshot: 'only-on-failure', trace: { diff --git a/tests/sanity/tests/utils.ts b/tests/sanity/tests/utils.ts index cb6ee9ad068..a056be2ceb4 100644 --- a/tests/sanity/tests/utils.ts +++ b/tests/sanity/tests/utils.ts @@ -3,6 +3,7 @@ import { Locator, Page } from '@playwright/test' export const PlatformURI = process.env.PLATFORM_URI as string export const PlatformTransactor = process.env.PLATFORM_TRANSACTOR as string export const PlatformUser = process.env.PLATFORM_USER as string +export const PlatformUserSecond = process.env.PLATFORM_USER_SECOND as string export const PlatformToken = process.env.PLATFORM_TOKEN as string export const PlatformSetting = process.env.SETTING as string From 29df4c73fa32c707c6aed4f4d635a701d57f7ada Mon Sep 17 00:00:00 2001 From: Alex Velichko Date: Tue, 21 Nov 2023 11:20:36 +0300 Subject: [PATCH 2/6] feat(tests): updated tests configs Signed-off-by: Alex Velichko --- tests/sanity/tests/playwright.config.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/sanity/tests/playwright.config.ts b/tests/sanity/tests/playwright.config.ts index 5a20e7448f7..c8428601fbd 100644 --- a/tests/sanity/tests/playwright.config.ts +++ b/tests/sanity/tests/playwright.config.ts @@ -3,12 +3,6 @@ import { config as dotenvConfig } from 'dotenv' dotenvConfig() const config: PlaywrightTestConfig = { - projects: [ - { - name: 'Tests', - use: { ...devices['Desktop Chrome'] } - } - ], use: { screenshot: 'only-on-failure', trace: { From 0d239305df3ab2dd72bc2d60fdbcd409a6765cb5 Mon Sep 17 00:00:00 2001 From: Alex Velichko Date: Tue, 21 Nov 2023 11:35:31 +0300 Subject: [PATCH 3/6] format Signed-off-by: Alex Velichko --- tests/sanity/tests/playwright.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sanity/tests/playwright.config.ts b/tests/sanity/tests/playwright.config.ts index c8428601fbd..97b3c7e13de 100644 --- a/tests/sanity/tests/playwright.config.ts +++ b/tests/sanity/tests/playwright.config.ts @@ -1,4 +1,4 @@ -import { devices, PlaywrightTestConfig } from '@playwright/test' +import { PlaywrightTestConfig } from '@playwright/test' import { config as dotenvConfig } from 'dotenv' dotenvConfig() From c4977e5644d873b351954775db6da931736c8307 Mon Sep 17 00:00:00 2001 From: Alex Velichko Date: Tue, 21 Nov 2023 22:38:00 +0300 Subject: [PATCH 4/6] feat(tests): udpated col test Signed-off-by: Alex Velichko --- tests/sanity/.env | 3 +- tests/sanity/storageSecond.json | 34 +++++++++++++ .../sanity/tests/collaborative/issues.spec.ts | 50 ++++++++----------- tests/sanity/tests/model/common-page.ts | 3 +- .../sanity/tests/model/tracker/issues-page.ts | 10 ++-- tests/sanity/tests/utils.ts | 2 +- 6 files changed, 66 insertions(+), 36 deletions(-) create mode 100644 tests/sanity/storageSecond.json diff --git a/tests/sanity/.env b/tests/sanity/.env index 210ce416f65..d51aba76164 100644 --- a/tests/sanity/.env +++ b/tests/sanity/.env @@ -3,4 +3,5 @@ PLATFORM_TRANSACTOR='ws://localhost:3334' PLATFORM_USER='user1' PLATFORM_USER_SECOND='user2' PLATFORM_TOKEN='eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbCI6InVzZXIxIiwid29ya3NwYWNlIjoic2FuaXR5LXdzIn0.hfUCqePHO-WNps2by4B-CYGKIpDpLG0WVCUUtU-SVI4' -SETTING=storage.json \ No newline at end of file +SETTING=storage.json +SETTING_SECOND=storageSecond.json \ No newline at end of file diff --git a/tests/sanity/storageSecond.json b/tests/sanity/storageSecond.json new file mode 100644 index 00000000000..31f49c7ead7 --- /dev/null +++ b/tests/sanity/storageSecond.json @@ -0,0 +1,34 @@ +{ + "cookies": [], + "origins": [ + { + "origin": "http://localhost:8083", + "localStorage": [ + { + "name": "login:metadata:LoginEmail", + "value": "user2" + }, + { + "name": "login:metadata:LoginTokens", + "value": "{\"sanity-ws\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjb25maXJtZWQiOnRydWUsImVtYWlsIjoidXNlcjIiLCJ3b3Jrc3BhY2UiOiJzYW5pdHktd3MiLCJwcm9kdWN0SWQiOiIifQ.810B-zY0JjmKWTeTNmhUWKPY4wkp5hGX3Ng6Y73NK7I\"}" + }, + { + "name": "login:metadata:LoginEndpoint", + "value": "ws://localhost:3334" + }, + { + "name": "#platform.notification.logging", + "value": "false" + }, + { + "name": "#platform.lazy.loading", + "value": "false" + }, + { + "name": "flagOpenInDesktopApp", + "value": "true" + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/sanity/tests/collaborative/issues.spec.ts b/tests/sanity/tests/collaborative/issues.spec.ts index adc05c0092d..c8873252a19 100644 --- a/tests/sanity/tests/collaborative/issues.spec.ts +++ b/tests/sanity/tests/collaborative/issues.spec.ts @@ -1,34 +1,27 @@ import { test } from '@playwright/test' -import { generateId, PlatformURI, PlatformUser, PlatformUserSecond } from '../utils' -import { SelectWorkspacePage } from '../model/select-workspace-page' +import { + generateId, + PlatformSetting, + PlatformSettingSecond, + PlatformURI, +} from '../utils' import { allure } from 'allure-playwright' -import { LoginPage } from '../model/login-page' import { NewIssue } from '../model/tracker/types' import { IssuesPage } from '../model/tracker/issues-page' import { LeftSideMenuPage } from '../model/left-side-menu-page' import { IssuesDetailsPage } from '../model/tracker/issues-details-page' +test.use({ + storageState: PlatformSetting +}) + test.describe('Collaborative test for issue', () => { test.beforeEach(async ({ page }) => { await allure.parentSuite('Collaborative test') await (await page.goto(`${PlatformURI}/workbench/sanity-ws/tracker/`))?.finished() }) - test('Issues can be assigned to another users', async ({ browser }) => { - const userFirstContext = await browser.newContext() - const userSecondContext = await browser.newContext() - - const userFirstPage = await userFirstContext.newPage() - const userSecondPage = await userSecondContext.newPage() - - // create issue - const loginPage = new LoginPage(userFirstPage) - await loginPage.goto() - await loginPage.login(PlatformUser, '1234') - - const selectWorkspacePage = new SelectWorkspacePage(userFirstPage) - await selectWorkspacePage.selectWorkspace('sanity-ws') - + test('Issues can be assigned to another users', async ({ page, browser }) => { const newIssue: NewIssue = { title: `Collaborative test for issue-${generateId()}`, description: 'Collaborative test for issue', @@ -44,25 +37,26 @@ test.describe('Collaborative test for issue', () => { filePath: 'cat.jpeg' } - const leftSideMenuPage = new LeftSideMenuPage(userFirstPage) + await (await page.goto(`${PlatformURI}/workbench/sanity-ws/tracker/`))?.finished() + const leftSideMenuPage = new LeftSideMenuPage(page) await leftSideMenuPage.buttonTracker.click() - const issuesPage = new IssuesPage(userFirstPage) - await issuesPage.modelSelectorAll.click() + const issuesPage = new IssuesPage(page) await issuesPage.createNewIssue(newIssue) + await issuesPage.linkSidebarAll.click() + await issuesPage.modelSelectorAll.click() + await issuesPage.searchIssueByName(newIssue.title) + await issuesPage.openIssueByName(newIssue.title) // check by another user - const loginPageSecond = new LoginPage(userSecondPage) - await loginPageSecond.goto() - await loginPageSecond.login(PlatformUserSecond, '1234') - - const selectWorkspacePageSecond = new SelectWorkspacePage(userSecondPage) - await selectWorkspacePageSecond.selectWorkspace('sanity-ws') - + const userSecondContext = await browser.newContext({ storageState: PlatformSettingSecond }) + const userSecondPage = await userSecondContext.newPage() + await (await userSecondPage.goto(`${PlatformURI}/workbench/sanity-ws/tracker/`))?.finished() const leftSideMenuPageSecond = new LeftSideMenuPage(userSecondPage) await leftSideMenuPageSecond.buttonTracker.click() const issuesPageSecond = new IssuesPage(userSecondPage) + await issuesPageSecond.linkSidebarAll.click() await issuesPageSecond.modelSelectorAll.click() await issuesPageSecond.searchIssueByName(newIssue.title) await issuesPageSecond.openIssueByName(newIssue.title) diff --git a/tests/sanity/tests/model/common-page.ts b/tests/sanity/tests/model/common-page.ts index f732f76d30a..15d481c2237 100644 --- a/tests/sanity/tests/model/common-page.ts +++ b/tests/sanity/tests/model/common-page.ts @@ -1,4 +1,4 @@ -import { Page } from '@playwright/test' +import { Page, expect } from '@playwright/test' export class CommonPage { async selectMenuItem (page: Page, name: string): Promise { @@ -49,6 +49,7 @@ export class CommonPage { async selectAssignee (page: Page, name: string): Promise { if (name !== 'first') { await page.locator('div.selectPopup input').fill(name.split(' ')[0]) + await expect(page.locator('div.selectPopup div.list-item')).toHaveCount(1) } await page.locator('div.selectPopup div.list-item').click() } diff --git a/tests/sanity/tests/model/tracker/issues-page.ts b/tests/sanity/tests/model/tracker/issues-page.ts index e6d609f14e4..d068e86584d 100644 --- a/tests/sanity/tests/model/tracker/issues-page.ts +++ b/tests/sanity/tests/model/tracker/issues-page.ts @@ -5,7 +5,6 @@ import { CommonTrackerPage } from './common-tracker-page' export class IssuesPage extends CommonTrackerPage { readonly page: Page - readonly pageHeader: Locator readonly modelSelectorAll: Locator readonly modelSelectorActive: Locator readonly modelSelectorBacklog: Locator @@ -24,14 +23,14 @@ export class IssuesPage extends CommonTrackerPage { readonly textPopupCreateNewIssueFile: Locator readonly buttonCreateIssue: Locator readonly inputSearch: Locator + readonly linkSidebarAll: Locator constructor (page: Page) { super(page) this.page = page - this.pageHeader = page.locator('div[class*="header"]', { hasText: 'Issues' }) - this.modelSelectorAll = this.pageHeader.locator('text=All') - this.modelSelectorActive = this.pageHeader.locator('text=Active') - this.modelSelectorBacklog = this.pageHeader.locator('text=Backlog') + this.modelSelectorAll = page.locator('div[data-id="tab-all"]') + this.modelSelectorActive = page.locator('div[data-id="tab-active"]') + this.modelSelectorBacklog = page.locator('div[data-id="tab-backlog"]') this.buttonCreateNewIssue = page.locator('button > span', { hasText: 'New issue' }) this.inputPopupCreateNewIssueTitle = page.locator('form[id="tracker:string:NewIssue"] input[type="text"]') this.inputPopupCreateNewIssueDescription = page.locator('form[id="tracker:string:NewIssue"] div.tiptap') @@ -59,6 +58,7 @@ export class IssuesPage extends CommonTrackerPage { this.textPopupCreateNewIssueFile = page.locator('div[class*="attachments"] > div[class*="attachment"]') this.buttonCreateIssue = page.locator('button > span', { hasText: 'Create issue' }) this.inputSearch = page.locator('input[placeholder="Search"]') + this.linkSidebarAll = page.locator('a[href$="all-issues"]') } async createNewIssue (data: NewIssue): Promise { diff --git a/tests/sanity/tests/utils.ts b/tests/sanity/tests/utils.ts index a056be2ceb4..03da9ea8e5a 100644 --- a/tests/sanity/tests/utils.ts +++ b/tests/sanity/tests/utils.ts @@ -4,8 +4,8 @@ export const PlatformURI = process.env.PLATFORM_URI as string export const PlatformTransactor = process.env.PLATFORM_TRANSACTOR as string export const PlatformUser = process.env.PLATFORM_USER as string export const PlatformUserSecond = process.env.PLATFORM_USER_SECOND as string -export const PlatformToken = process.env.PLATFORM_TOKEN as string export const PlatformSetting = process.env.SETTING as string +export const PlatformSettingSecond = process.env.SETTING_SECOND as string function toHex (value: number, chars: number): string { const result = value.toString(16) From 71c10810ee3693bb49c3238b0218e52ca520b339 Mon Sep 17 00:00:00 2001 From: Alex Velichko Date: Tue, 21 Nov 2023 22:39:51 +0300 Subject: [PATCH 5/6] format Signed-off-by: Alex Velichko --- tests/sanity/tests/collaborative/issues.spec.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/sanity/tests/collaborative/issues.spec.ts b/tests/sanity/tests/collaborative/issues.spec.ts index c8873252a19..0ef93f34f7a 100644 --- a/tests/sanity/tests/collaborative/issues.spec.ts +++ b/tests/sanity/tests/collaborative/issues.spec.ts @@ -1,10 +1,5 @@ import { test } from '@playwright/test' -import { - generateId, - PlatformSetting, - PlatformSettingSecond, - PlatformURI, -} from '../utils' +import { generateId, PlatformSetting, PlatformSettingSecond, PlatformURI } from '../utils' import { allure } from 'allure-playwright' import { NewIssue } from '../model/tracker/types' import { IssuesPage } from '../model/tracker/issues-page' From 2367fb9448ae6e66b8f520a42786e77b96f3a4e2 Mon Sep 17 00:00:00 2001 From: Alex Velichko Date: Wed, 22 Nov 2023 11:35:32 +0300 Subject: [PATCH 6/6] feat(tests): updated issue col test Signed-off-by: Alex Velichko --- .../sanity/tests/collaborative/issues.spec.ts | 23 ++++++++++--------- tests/sanity/tests/utils.ts | 7 +++++- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/tests/sanity/tests/collaborative/issues.spec.ts b/tests/sanity/tests/collaborative/issues.spec.ts index 0ef93f34f7a..f88515e498b 100644 --- a/tests/sanity/tests/collaborative/issues.spec.ts +++ b/tests/sanity/tests/collaborative/issues.spec.ts @@ -1,5 +1,5 @@ import { test } from '@playwright/test' -import { generateId, PlatformSetting, PlatformSettingSecond, PlatformURI } from '../utils' +import { generateId, getSecondPage, PlatformSetting, PlatformURI } from '../utils' import { allure } from 'allure-playwright' import { NewIssue } from '../model/tracker/types' import { IssuesPage } from '../model/tracker/issues-page' @@ -32,6 +32,16 @@ test.describe('Collaborative test for issue', () => { filePath: 'cat.jpeg' } + // open second page + const userSecondPage = await getSecondPage(browser) + await (await userSecondPage.goto(`${PlatformURI}/workbench/sanity-ws/tracker/`))?.finished() + const leftSideMenuPageSecond = new LeftSideMenuPage(userSecondPage) + await leftSideMenuPageSecond.buttonTracker.click() + const issuesPageSecond = new IssuesPage(userSecondPage) + await issuesPageSecond.linkSidebarAll.click() + await issuesPageSecond.modelSelectorAll.click() + + // create a new issue by first user await (await page.goto(`${PlatformURI}/workbench/sanity-ws/tracker/`))?.finished() const leftSideMenuPage = new LeftSideMenuPage(page) await leftSideMenuPage.buttonTracker.click() @@ -43,16 +53,7 @@ test.describe('Collaborative test for issue', () => { await issuesPage.searchIssueByName(newIssue.title) await issuesPage.openIssueByName(newIssue.title) - // check by another user - const userSecondContext = await browser.newContext({ storageState: PlatformSettingSecond }) - const userSecondPage = await userSecondContext.newPage() - await (await userSecondPage.goto(`${PlatformURI}/workbench/sanity-ws/tracker/`))?.finished() - const leftSideMenuPageSecond = new LeftSideMenuPage(userSecondPage) - await leftSideMenuPageSecond.buttonTracker.click() - - const issuesPageSecond = new IssuesPage(userSecondPage) - await issuesPageSecond.linkSidebarAll.click() - await issuesPageSecond.modelSelectorAll.click() + // check created issued by second user await issuesPageSecond.searchIssueByName(newIssue.title) await issuesPageSecond.openIssueByName(newIssue.title) diff --git a/tests/sanity/tests/utils.ts b/tests/sanity/tests/utils.ts index 03da9ea8e5a..ddfe66b1694 100644 --- a/tests/sanity/tests/utils.ts +++ b/tests/sanity/tests/utils.ts @@ -1,4 +1,4 @@ -import { Locator, Page } from '@playwright/test' +import { Browser, Locator, Page } from '@playwright/test' export const PlatformURI = process.env.PLATFORM_URI as string export const PlatformTransactor = process.env.PLATFORM_TRANSACTOR as string @@ -59,3 +59,8 @@ export async function fillSearch (page: Page, search: string): Promise return searchBox } + +export async function getSecondPage (browser: Browser): Promise { + const userSecondContext = await browser.newContext({ storageState: PlatformSettingSecond }) + return await userSecondContext.newPage() +}