Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions cypress/component/menuItems.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ import {
moveItem,
newDashboardItem,
outdentItem,
pageTitle,
parentOfPosition,
removeItem,
toEditableMenuItems,
toMenuItemPayload,
} from '../../src/shared/utils/menuItems.js'

Expand Down Expand Up @@ -175,6 +177,24 @@ describe('menu items', () => {
expect(menuItemErrors({ ...page, targetId: null }).target).to.equal(true)
})

it('names a page by its title, an untitled start page as the dashboard', () => {
expect(pageTitle({ title: 'Intake', page_type: 'grid' })).to.equal('Intake')
expect(pageTitle({ title: null, page_type: 'startpage' })).to.equal('Dashboard')
expect(pageTitle({ title: 'Home', page_type: 'startpage' })).to.equal('Home')
})

it('turns the stored menu into editor items that keep their parent', () => {
const editable = toEditableMenuItems([
{ id: 1, label: 'Cases', icon: 'star', targetType: 'table', targetId: 4, url: null, technicalName: 'cases', parentId: null },
{ id: 2, label: 'Docs', targetType: 'url', url: 'https://example.org', technicalName: 'docs', parentId: 1 },
])

expect(editable.map(entry => entry.key)).to.deep.equal(['item-1', 'item-2'])
expect(editable[0]).to.deep.include({ label: 'Cases', icon: 'star', targetType: 'table', targetId: 4, url: '', parentKey: null })
expect(editable[1]).to.deep.include({ icon: null, targetId: null, url: 'https://example.org', parentKey: 'item-1' })
expect(toEditableMenuItems(null)).to.deep.equal([])
})

it('routes a page, view or table entry inside the app and leaves a link outside it', () => {
expect(menuItemRoute({ targetType: 'page', targetId: 12, technicalName: 'dashboard' }, 7)).to.equal('/application/7/menu/dashboard')
expect(menuItemRoute({ targetType: 'view', technicalName: 'home' }, 7)).to.equal('/application/7/menu/home')
Expand Down
84 changes: 83 additions & 1 deletion playwright/e2e/application.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import type { APIRequestContext } from '@playwright/test'
import { test, expect } from '../support/fixtures'
import { ocsRequest, type TestUser } from '../support/api'
import { createContext, loadContext } from '../support/commands'

test.use({ viewport: { width: 1600, height: 1000 } })

Expand Down Expand Up @@ -93,7 +94,7 @@

await page.locator('[data-cy="context-menu-overview"]').click()
await expect(page).toHaveURL(new RegExp(`/application/${contextId}$`))
await expect(page.locator('[data-cy="contextPageLink"]', { hasText: 'Front page' })).toBeVisible()
await expect(page.locator('[data-cy="page-card"]').filter({ hasText: 'Front page' })).toBeVisible()
})

test('A menu item whose page is gone shows as broken', async ({ userPage: { page, user } }) => {
Expand Down Expand Up @@ -122,4 +123,85 @@
await expect(startPage).toContainText('Dashboard')
await expect(page.locator('h1', { hasText: tableTitle })).toBeVisible({ timeout: 30000 })
})

test('A page with widgets added on the overview gets a menu entry and opens in edit mode', async ({ userPage: { page } }) => {
await page.goto('/index.php/apps/tables')
await createContext(page, 'overview application')
await loadContext(page, 'overview application')

await expect(page.locator('[data-cy="page-card"]')).toHaveCount(1)
await expect(page.locator('[data-cy="page-card"]').first()).toContainText('Dashboard')

await page.locator('[data-cy="context-add-page"]').getByRole('button').first().click()
await page.getByRole('menuitem', { name: 'Page with widgets' }).click()
const form = page.getByRole('dialog', { name: 'New page' })
await form.getByRole('textbox', { name: 'Title' }).fill('Intake home')
await page.locator('[data-cy="contextPageSubmit"]').click()

await expect(page).toHaveURL(/\/application\/\d+\/page\/\d+\?edit=1$/)
await expect(page.locator('[data-cy="context-breadcrumb"]')).toContainText('Intake home')
await expect(page.locator('[data-cy="gridPageSave"]')).toBeVisible()

await page.locator('[data-cy="gridPageCancel"]').click()
await page.locator('[data-cy="context-menu-overview"]').click()
const intake = page.locator('[data-cy="page-card"]').filter({ hasText: 'Intake home' })
await expect(intake).toContainText('Page with widgets')
await expect(page.locator('[data-cy="context-menu-preview-item"]').filter({ hasText: 'Intake home' })).toBeVisible()
})

test('A menu entry is reordered with its buttons, sits under another one and keeps its place after a reload', async ({ userPage: { page } }) => {
await page.goto('/index.php/apps/tables')
await createContext(page, 'nested menu application')
await loadContext(page, 'nested menu application')

await page.locator('[data-cy="context-menu-edit"]').click()
for (const [label, url] of [['Handbook', 'https://docs.nextcloud.com'], ['Forum', 'https://help.nextcloud.com']]) {
await page.locator('[data-cy="menuItemAdd"]').click()
const row = page.locator('[data-cy="menuItemRow"]').last()
await row.getByRole('textbox', { name: 'Label' }).fill(label)
await row.getByRole('textbox', { name: 'Link' }).fill(url)
}

// Without a pointer: move Forum above Handbook, then put Handbook under it
const rows = page.locator('[data-cy="menuItemRow"]')
await rows.nth(2).locator('[data-cy="menuItemMoveUp"]').click()
await expect(rows.nth(1).getByRole('textbox', { name: 'Label' })).toHaveValue('Forum')
await rows.nth(2).locator('[data-cy="menuItemIndent"]').click()
await expect(rows.nth(2).locator('[data-cy="menuItemOutdent"]')).toBeVisible()

const saveResponse = page.waitForResponse(response => response.url().includes('/apps/tables/api/2/contexts/') && response.request().method() === 'PUT')
await page.locator('[data-cy="context-menu-save"]').click()
expect((await saveResponse).status()).toBe(200)

Check failure on line 174 in playwright/e2e/application.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright (stable35)

[chromium] › playwright/e2e/application.spec.ts:152:2 › Applications › A menu entry is reordered with its buttons

1) [chromium] › playwright/e2e/application.spec.ts:152:2 › Applications › A menu entry is reordered with its buttons, sits under another one and keeps its place after a reload Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toBe(expected) // Object.is equality Expected: 200 Received: 500 172 | const saveResponse = page.waitForResponse(response => response.url().includes('/apps/tables/api/2/contexts/') && response.request().method() === 'PUT') 173 | await page.locator('[data-cy="context-menu-save"]').click() > 174 | expect((await saveResponse).status()).toBe(200) | ^ 175 | 176 | await page.reload() 177 | const items = page.locator('[data-cy="context-menu-preview-item"]') at /home/runner/work/tables/tables/playwright/e2e/application.spec.ts:174:41

Check failure on line 174 in playwright/e2e/application.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright (stable35)

[chromium] › playwright/e2e/application.spec.ts:152:2 › Applications › A menu entry is reordered with its buttons

1) [chromium] › playwright/e2e/application.spec.ts:152:2 › Applications › A menu entry is reordered with its buttons, sits under another one and keeps its place after a reload Error: expect(received).toBe(expected) // Object.is equality Expected: 200 Received: 500 172 | const saveResponse = page.waitForResponse(response => response.url().includes('/apps/tables/api/2/contexts/') && response.request().method() === 'PUT') 173 | await page.locator('[data-cy="context-menu-save"]').click() > 174 | expect((await saveResponse).status()).toBe(200) | ^ 175 | 176 | await page.reload() 177 | const items = page.locator('[data-cy="context-menu-preview-item"]') at /home/runner/work/tables/tables/playwright/e2e/application.spec.ts:174:41

await page.reload()
const items = page.locator('[data-cy="context-menu-preview-item"]')
await expect(items).toHaveCount(3)
await expect(items.nth(0)).toContainText('Dashboard')
await expect(items.nth(1)).toContainText('Forum')
await expect(items.nth(2)).toContainText('2.1')
await expect(items.nth(2)).toContainText('Handbook')
})

test('A menu entry can be pointed at a page of the application', async ({ userPage: { page, user } }) => {
const { contextId } = await createApplicationWithMenu(page.request, user, 'page target application')
await ocsRequest(page.request, user, { method: 'POST', url: `${API}/contexts/${contextId}/pages?format=json`, data: { title: 'Reports' } })

await page.goto(`/index.php/apps/tables/#/application/${contextId}`)
await page.locator('[data-cy="context-menu-edit"]').click()
await page.locator('[data-cy="menuItemAdd"]').click()
const row = page.locator('[data-cy="menuItemRow"]').last()
await row.locator('[data-cy="menuItemTarget"] input').click()
await page.locator('.vs__dropdown-menu li').filter({ hasText: 'Reports (page)' }).click()
await expect(row.getByRole('textbox', { name: 'Label' })).toHaveValue('Reports')

const saveResponse = page.waitForResponse(response => response.url().includes('/apps/tables/api/2/contexts/') && response.request().method() === 'PUT')
await page.locator('[data-cy="context-menu-save"]').click()
expect((await saveResponse).status()).toBe(200)
await expect(page.locator('[data-cy="context-menu-preview-item"]').filter({ hasText: 'Reports' }).last()).toBeVisible()

await page.goto(`/index.php/apps/tables/app/${contextId}`)
await page.locator('[data-cy="application-nav-item"]').filter({ hasText: 'Reports' }).getByRole('link').click()
await expect(page).toHaveURL(/\/menu\/reports$/)
await expect(page.locator('[data-cy="gridPage"]')).toBeVisible()
})
})
5 changes: 4 additions & 1 deletion playwright/e2e/column-relation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,11 @@ test.describe('Test column relation', () => {

await page.locator('[data-cy="editContextSubmitBtn"]').click()

// load the context and verify the relation label is rendered without crashing
// the tables of an application render in the application itself, opened on its own
await loadContext(page, contextTitle)
const contextId = page.url().match(/\/application\/(\d+)/)?.[1]
await page.goto(`/index.php/apps/tables/app/${contextId}`)
// verify the relation label is rendered without crashing
await expect(
page.locator('[data-cy="ncTable"] [data-cy="customTableRow"]').filter({ hasText: 'Bob' }),
).toBeVisible()
Expand Down
24 changes: 16 additions & 8 deletions playwright/e2e/context-grid-pages.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@ async function getApplication(request: APIRequestContext, user: TestUser, contex
return (await res.json()).ocs.data
}

async function openApplication(page: Page, contextId: number, path = '') {
await page.goto(`/index.php/apps/tables/#/application/${contextId}${path}`)
/**
* Opens the start page of an application inside Tables; the application itself opens on its overview.
*/
async function openApplication(page: Page, user: TestUser, contextId: number) {
const application = await getApplication(page.request, user, contextId)
const startPage = Object.values(application.pages as Record<string, { id: number, page_type: string }>).find(entry => entry.page_type === 'startpage')
await page.goto(`/index.php/apps/tables/#/application/${contextId}/page/${startPage!.id}`)
await expect(page.locator('[data-cy="gridPage"]')).toBeVisible({ timeout: 30000 })
}

Expand All @@ -48,7 +53,7 @@ test.describe('Application pages on the grid', () => {
const second = await createTableViaApi(page.request, user, 'grid second table')
const contextId = await createApplicationViaApi(page.request, user, 'grid existing app', [first, second])

await openApplication(page, contextId)
await openApplication(page, user, contextId)

const items = page.locator('[data-cy="gridItem"]')
await expect(items).toHaveCount(2)
Expand All @@ -67,7 +72,7 @@ test.describe('Application pages on the grid', () => {
test('A header added to the start page is saved with the order filled in', async ({ userPage: { page, user } }) => {
const table = await createTableViaApi(page.request, user, 'grid header table')
const contextId = await createApplicationViaApi(page.request, user, 'grid header app', [table])
await openApplication(page, contextId)
await openApplication(page, user, contextId)

await page.locator('[data-cy="gridPageEdit"]').click()
await page.locator('[data-cy="gridPageAddWidget"]').click()
Expand Down Expand Up @@ -96,7 +101,7 @@ test.describe('Application pages on the grid', () => {
const inApp = await createTableViaApi(page.request, user, 'grid table in app')
const notInApp = await createTableViaApi(page.request, user, 'grid table not in app')
const contextId = await createApplicationViaApi(page.request, user, 'grid new page app', [inApp])
await openApplication(page, contextId)
await openApplication(page, user, contextId)

await page.locator('[data-cy="contextPageCreate"]').click()
const pageForm = page.getByRole('dialog', { name: 'New page' })
Expand Down Expand Up @@ -134,13 +139,16 @@ test.describe('Application pages on the grid', () => {
test('A page created without a technical name gets one from its title, and keeps one on rename', async ({ userPage: { page, user } }) => {
const table = await createTableViaApi(page.request, user, 'grid name table')
const contextId = await createApplicationViaApi(page.request, user, 'grid name app', [table])
await openApplication(page, contextId)
await openApplication(page, user, contextId)

await page.locator('[data-cy="contextPageCreate"]').click()
const pageForm = page.getByRole('dialog', { name: 'New page' })
await pageForm.getByRole('textbox', { name: 'Title' }).fill('Open cases')
const created = page.waitForResponse(r => r.url().includes('/pages') && r.request().method() === 'POST')
await page.locator('[data-cy="contextPageSubmit"]').click()
await expect(page).toHaveURL(/\/application\/\d+\/page\/\d+/)
const createdPage = (await (await created).json()).ocs.data
expect(createdPage.technical_name).toBe('open_cases')
await expect(page).toHaveURL(new RegExp(`/page/${createdPage.id}$`))

const pages = Object.values((await getApplication(page.request, user, contextId)).pages as Record<string, { page_type: string, technical_name: string }>)
expect(pages.map(entry => entry.technical_name).sort()).toEqual(['dashboard', 'open_cases'])
Expand Down Expand Up @@ -176,7 +184,7 @@ test.describe('Application pages on the grid', () => {
const shareeContext = await browser.newContext({ baseURL, viewport: { width: 1600, height: 1000 } })
const shareePage = await shareeContext.newPage()
await login(shareePage, sharee)
await openApplication(shareePage, contextId)
await openApplication(shareePage, sharee, contextId)

await expect(shareePage.locator('h1', { hasText: 'grid shared table' })).toBeVisible()
await expect(shareePage.locator('[data-cy="contextPageLink"]', { hasText: 'Shared overview' })).toBeVisible()
Expand Down
46 changes: 33 additions & 13 deletions playwright/e2e/context.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,20 @@
await loadContext(page, contextTitle)
}

/**
* Inside Tables the application page is where an application is configured; its tables and
* views render in the application itself.
*/
async function openApplication(page: Page, contextTitle: string) {
await loadContext(page, contextTitle)
const contextId = page.url().match(/\/application\/(\d+)/)?.[1]
if (!contextId) {
throw new Error(`Could not find the id of application ${contextTitle}`)
}
await page.goto(`/index.php/apps/tables/app/${contextId}`)
await expect(page.locator('[data-cy="application-nav-header"]')).toContainText(contextTitle, { timeout: 10000 })
}

async function selectFromVueDropdown(page: Page, inputSelector: string, value: string) {
const input = page.locator(inputSelector).first()
await input.click()
Expand Down Expand Up @@ -89,14 +103,13 @@
const updateContextReq = page.waitForResponse(r => r.url().includes('/apps/tables/') && r.request().method() === 'PUT')
await page.locator('[data-cy="editContextSubmitBtn"]').click()
await updateContextReq
await expect(page.getByRole('dialog', { name: 'Edit application' })).toBeHidden({ timeout: 10000 })

Check failure on line 106 in playwright/e2e/context.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright (master)

[chromium] › playwright/e2e/context.spec.ts:76:2 › Manage a context › Update and add resources

1) [chromium] › playwright/e2e/context.spec.ts:76:2 › Manage a context › Update and add resources Error: expect(locator).toBeHidden() failed Locator: getByRole('dialog', { name: 'Edit application' }) Expected: hidden Received: visible Timeout: 10000ms Call log: - Expect "toBeHidden" getByRole('dialog', { name: 'Edit application' }) with timeout 10000ms - waiting for getByRole('dialog', { name: 'Edit application' }) 24 × locator resolved to <div role="dialog" tabindex="-1" aria-modal="true" data-v-c6039372="" data-v-adda232f="" data-v-b8054f62="" data-v-owner="819" data-cy="editContextModal" aria-labelledby="nc-vue-149" class="dialog__modal modal-mask" aria-describedby="modal-description-nc-vue-150">…</div> - unexpected value "visible" 104 | await page.locator('[data-cy="editContextSubmitBtn"]').click() 105 | await updateContextReq > 106 | await expect(page.getByRole('dialog', { name: 'Edit application' })).toBeHidden({ timeout: 10000 }) | ^ 107 | 108 | await expect(page.locator('[data-cy="navigationContextItem"]').filter({ hasText: `updated ${contextTitle}` })).toBeVisible() 109 | await openApplication(page, `updated ${contextTitle}`) at /home/runner/work/tables/tables/playwright/e2e/context.spec.ts:106:72

Check failure on line 106 in playwright/e2e/context.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright (stable35)

[chromium] › playwright/e2e/context.spec.ts:76:2 › Manage a context › Update and add resources

2) [chromium] › playwright/e2e/context.spec.ts:76:2 › Manage a context › Update and add resources Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(locator).toBeHidden() failed Locator: getByRole('dialog', { name: 'Edit application' }) Expected: hidden Received: visible Timeout: 10000ms Call log: - Expect "toBeHidden" getByRole('dialog', { name: 'Edit application' }) with timeout 10000ms - waiting for getByRole('dialog', { name: 'Edit application' }) 24 × locator resolved to <div role="dialog" tabindex="-1" aria-modal="true" data-v-c6039372="" data-v-adda232f="" data-v-b8054f62="" data-v-owner="819" data-cy="editContextModal" aria-labelledby="nc-vue-144" class="dialog__modal modal-mask" aria-describedby="modal-description-nc-vue-145">…</div> - unexpected value "visible" 104 | await page.locator('[data-cy="editContextSubmitBtn"]').click() 105 | await updateContextReq > 106 | await expect(page.getByRole('dialog', { name: 'Edit application' })).toBeHidden({ timeout: 10000 }) | ^ 107 | 108 | await expect(page.locator('[data-cy="navigationContextItem"]').filter({ hasText: `updated ${contextTitle}` })).toBeVisible() 109 | await openApplication(page, `updated ${contextTitle}`) at /home/runner/work/tables/tables/playwright/e2e/context.spec.ts:106:72

Check failure on line 106 in playwright/e2e/context.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright (stable35)

[chromium] › playwright/e2e/context.spec.ts:76:2 › Manage a context › Update and add resources

2) [chromium] › playwright/e2e/context.spec.ts:76:2 › Manage a context › Update and add resources Error: expect(locator).toBeHidden() failed Locator: getByRole('dialog', { name: 'Edit application' }) Expected: hidden Received: visible Timeout: 10000ms Call log: - Expect "toBeHidden" getByRole('dialog', { name: 'Edit application' }) with timeout 10000ms - waiting for getByRole('dialog', { name: 'Edit application' }) 24 × locator resolved to <div role="dialog" tabindex="-1" aria-modal="true" data-v-c6039372="" data-v-adda232f="" data-v-b8054f62="" data-v-owner="819" data-cy="editContextModal" aria-labelledby="nc-vue-144" class="dialog__modal modal-mask" aria-describedby="modal-description-nc-vue-145">…</div> - unexpected value "visible" 104 | await page.locator('[data-cy="editContextSubmitBtn"]').click() 105 | await updateContextReq > 106 | await expect(page.getByRole('dialog', { name: 'Edit application' })).toBeHidden({ timeout: 10000 }) | ^ 107 | 108 | await expect(page.locator('[data-cy="navigationContextItem"]').filter({ hasText: `updated ${contextTitle}` })).toBeVisible() 109 | await openApplication(page, `updated ${contextTitle}`) at /home/runner/work/tables/tables/playwright/e2e/context.spec.ts:106:72

Check failure on line 106 in playwright/e2e/context.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright (stable33)

[chromium] › playwright/e2e/context.spec.ts:76:2 › Manage a context › Update and add resources

1) [chromium] › playwright/e2e/context.spec.ts:76:2 › Manage a context › Update and add resources Error: expect(locator).toBeHidden() failed Locator: getByRole('dialog', { name: 'Edit application' }) Expected: hidden Received: visible Timeout: 10000ms Call log: - Expect "toBeHidden" getByRole('dialog', { name: 'Edit application' }) with timeout 10000ms - waiting for getByRole('dialog', { name: 'Edit application' }) 24 × locator resolved to <div role="dialog" tabindex="-1" aria-modal="true" data-v-c6039372="" data-v-adda232f="" data-v-b8054f62="" data-v-owner="819" data-cy="editContextModal" aria-labelledby="nc-vue-126" class="dialog__modal modal-mask" aria-describedby="modal-description-nc-vue-127">…</div> - unexpected value "visible" 104 | await page.locator('[data-cy="editContextSubmitBtn"]').click() 105 | await updateContextReq > 106 | await expect(page.getByRole('dialog', { name: 'Edit application' })).toBeHidden({ timeout: 10000 }) | ^ 107 | 108 | await expect(page.locator('[data-cy="navigationContextItem"]').filter({ hasText: `updated ${contextTitle}` })).toBeVisible() 109 | await openApplication(page, `updated ${contextTitle}`) at /home/runner/work/tables/tables/playwright/e2e/context.spec.ts:106:72

await expect(page.locator('[data-cy="navigationContextItem"]').filter({ hasText: `updated ${contextTitle}` })).toBeVisible()
await loadContext(page, `updated ${contextTitle}`)
await openApplication(page, `updated ${contextTitle}`)

await expect(page.locator('h1', { hasText: `updated ${contextTitle}` })).toBeVisible()
await expect(page.locator('h1', { hasText: tableTitle })).toBeVisible()
await expect(page.locator('h1', { hasText: viewTitle })).toBeVisible()
await expect(page.locator('h1', { hasText: tableTitle })).toBeVisible({ timeout: 10000 })
await expect(page.locator('h1', { hasText: viewTitle })).toBeVisible({ timeout: 10000 })
})

test('Share context with resources', async ({ userPage: { page }, request }) => {
Expand All @@ -119,18 +132,16 @@
await updateResponse
await expect(page.locator('[class*="toast_success"]').first()).toBeVisible({ timeout: 10000 })

await loadContext(page, contextTitle)
await expect(page.locator('h1', { hasText: contextTitle })).toBeVisible({ timeout: 10000 })
await openApplication(page, contextTitle)
await expect(page.locator('h1', { hasText: tableTitle })).toBeVisible({ timeout: 10000 })

// verify context was shared properly
await page.context().clearCookies()
await login(page, nonLocalUser)
await page.goto('/index.php/apps/tables')

await loadContext(page, contextTitle)
await expect(page.locator('h1', { hasText: contextTitle })).toBeVisible()
await expect(page.locator('h1', { hasText: tableTitle })).toBeVisible()
await openApplication(page, contextTitle)
await expect(page.locator('h1', { hasText: tableTitle })).toBeVisible({ timeout: 10000 })
})

test('Transfer context', async ({ userPage: { page }, request }) => {
Expand Down Expand Up @@ -221,15 +232,21 @@
await page.locator('[data-cy="editContextSubmitBtn"]').click()

await expect(page.locator('h1', { hasText: contextTitle })).toBeVisible()
await expect(page.locator('h1', { hasText: tableTitle })).toBeVisible()
await openApplication(page, contextTitle)
await expect(page.locator('h1', { hasText: tableTitle })).toBeVisible({ timeout: 10000 })

await page.goto('/index.php/apps/tables')
await loadContext(page, contextTitle)
await openContextEditModal(page, contextTitle)
await page.locator('[data-cy="contextResourceList"] button').filter({ hasText: 'Delete' }).click({ force: true })

await expect(page.locator('[data-cy="contextResourceList"]', { hasText: tableTitle })).toBeHidden()
await page.locator('[data-cy="editContextSubmitBtn"]').click()

await expect(page.locator('h1', { hasText: contextTitle })).toBeVisible()
await openApplication(page, contextTitle)
// The application has loaded once its loading icon is gone; only then does a missing table mean anything
await expect(page.locator('.main-context-view > .icon-loading')).toHaveCount(0, { timeout: 10000 })
await expect(page.locator('h1', { hasText: tableTitle })).toBeHidden()
})

Expand All @@ -248,7 +265,10 @@
await expect(page.locator('[data-cy="contextResourceList"]')).toContainText(tableTitle)
await expect(page.locator('[data-cy="contextResourcePerms"]')).toContainText(tableTitle)
await page.locator('[data-cy="editContextSubmitBtn"]').click()
await expect(page.getByRole('dialog', { name: 'Edit application' })).toBeHidden({ timeout: 10000 })

await openApplication(page, contextTitle)
await expect(page.locator('h1', { hasText: tableTitle })).toBeVisible({ timeout: 10000 })
await createTextLineColumn(page, 'title', '', '', true)
await page.locator('button').filter({ hasText: 'Create row' }).first().click()
await fillInValueTextLine(page, 'title', 'first row')
Expand Down Expand Up @@ -293,16 +313,16 @@
await updatePermsResponse

await expect(page.locator('h1', { hasText: contextTitle })).toBeVisible({ timeout: 10000 })
await openApplication(page, contextTitle)
await expect(page.locator('h1', { hasText: tableTitle })).toBeVisible({ timeout: 10000 })

Check failure on line 317 in playwright/e2e/context.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright (stable35)

[chromium] › playwright/e2e/context.spec.ts:280:2 › Manage a context › Modify context resources and their permissions

3) [chromium] › playwright/e2e/context.spec.ts:280:2 › Manage a context › Modify context resources and their permissions Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(locator).toBeVisible() failed Locator: locator('h1').filter({ hasText: 'test table perms' }) Expected: visible Timeout: 10000ms Error: element(s) not found Call log: - Expect "toBeVisible" locator('h1').filter({ hasText: 'test table perms' }) with timeout 10000ms - waiting for locator('h1').filter({ hasText: 'test table perms' }) 315 | await expect(page.locator('h1', { hasText: contextTitle })).toBeVisible({ timeout: 10000 }) 316 | await openApplication(page, contextTitle) > 317 | await expect(page.locator('h1', { hasText: tableTitle })).toBeVisible({ timeout: 10000 }) | ^ 318 | 319 | // verify that shared user can modify and delete data in the resource 320 | await page.context().clearCookies() at /home/runner/work/tables/tables/playwright/e2e/context.spec.ts:317:61

// verify that shared user can modify and delete data in the resource
await page.context().clearCookies()
await login(page, nonLocalUser)
await page.goto('/index.php/apps/tables')

await loadContext(page, contextTitle)
await expect(page.locator('h1', { hasText: contextTitle })).toBeVisible()
await expect(page.locator('h1', { hasText: tableTitle })).toBeVisible()
await openApplication(page, contextTitle)
await expect(page.locator('h1', { hasText: tableTitle })).toBeVisible({ timeout: 10000 })

await page.locator('button').filter({ hasText: 'Create row' }).first().click()
await fillInValueTextLine(page, 'title', 'first row')
Expand Down
Loading
Loading