mirror of https://github.com/nocodb/nocodb
Raju Udava
2 years ago
committed by
GitHub
64 changed files with 411 additions and 328 deletions
@ -1,109 +1,98 @@
|
||||
import { expect, test } from '@playwright/test'; |
||||
import { DashboardPage } from '../pages/Dashboard'; |
||||
import { GridPage } from '../pages/Dashboard/Grid'; |
||||
import setup from '../setup'; |
||||
import { DashboardPage } from '../../pages/Dashboard'; |
||||
import { GridPage } from '../../pages/Dashboard/Grid'; |
||||
import setup from '../../setup'; |
||||
|
||||
test.describe('Verify cell selection', () => { |
||||
let dashboard: DashboardPage, grid: GridPage; |
||||
let context: any; |
||||
|
||||
test.beforeEach(async ({ page }) => { |
||||
context = await setup({ page }); |
||||
context = await setup({ page, isEmptyProject: false }); |
||||
dashboard = new DashboardPage(page, context.project); |
||||
grid = dashboard.grid; |
||||
await dashboard.closeAllTabs(); |
||||
}); |
||||
|
||||
test('#1 when range is selected, it has correct number of selected cells', async () => { |
||||
test('Suite-1', async () => { |
||||
// #1 when range is selected, it has correct number of selected cells
|
||||
await dashboard.treeView.openTable({ title: 'Customer' }); |
||||
await grid.selectRange({ |
||||
start: { index: 0, columnHeader: 'FirstName' }, |
||||
end: { index: 2, columnHeader: 'Email' }, |
||||
}); |
||||
|
||||
expect(await grid.selectedCount()).toBe(9); |
||||
}); |
||||
await dashboard.closeAllTabs(); |
||||
|
||||
test('#2 when copied with clipboard, it copies correct text', async () => { |
||||
// #2 when copied with clipboard, it copies correct text
|
||||
await dashboard.treeView.openTable({ title: 'Customer' }); |
||||
await grid.selectRange({ |
||||
start: { index: 0, columnHeader: 'FirstName' }, |
||||
end: { index: 1, columnHeader: 'LastName' }, |
||||
}); |
||||
|
||||
expect(await grid.copyWithKeyboard()).toBe('MARY \t SMITH\n' + ' PATRICIA \t JOHNSON\n'); |
||||
}); |
||||
await dashboard.closeAllTabs(); |
||||
|
||||
test('#3 when copied with mouse, it copies correct text', async () => { |
||||
// #3 when copied with mouse, it copies correct text
|
||||
await dashboard.treeView.openTable({ title: 'Customer' }); |
||||
await grid.selectRange({ |
||||
start: { index: 0, columnHeader: 'FirstName' }, |
||||
end: { index: 1, columnHeader: 'LastName' }, |
||||
}); |
||||
|
||||
expect(await grid.copyWithMouse({ index: 0, columnHeader: 'FirstName' })).toBe( |
||||
'MARY \t SMITH\n' + ' PATRICIA \t JOHNSON\n' |
||||
); |
||||
await dashboard.closeAllTabs(); |
||||
}); |
||||
|
||||
// FIXME: this is edge case, better be moved to integration tests
|
||||
test('#4 when cell inside selection range is clicked, it clears previous selection', async () => { |
||||
test('Suite-2', async ({ page }) => { |
||||
// #4 when cell inside selection range is clicked, it clears previous selection
|
||||
await dashboard.treeView.openTable({ title: 'Country' }); |
||||
await grid.selectRange({ |
||||
start: { index: 0, columnHeader: 'Country' }, |
||||
end: { index: 2, columnHeader: 'City List' }, |
||||
}); |
||||
|
||||
expect(await grid.selectedCount()).toBe(9); |
||||
|
||||
await grid.cell.get({ index: 0, columnHeader: 'Country' }).click(); |
||||
|
||||
expect(await grid.selectedCount()).toBe(1); |
||||
expect(await grid.cell.verifyCellActiveSelected({ index: 0, columnHeader: 'Country' })); |
||||
}); |
||||
await dashboard.closeAllTabs(); |
||||
|
||||
// FIXME: this is edge case, better be moved to integration tests
|
||||
test('#5 when cell outside selection range is clicked, it clears previous selection', async () => { |
||||
// #5 when cell outside selection range is clicked, it clears previous selection
|
||||
await dashboard.treeView.openTable({ title: 'Country' }); |
||||
await grid.selectRange({ |
||||
start: { index: 0, columnHeader: 'Country' }, |
||||
end: { index: 2, columnHeader: 'City List' }, |
||||
}); |
||||
|
||||
expect(await grid.selectedCount()).toBe(9); |
||||
|
||||
await grid.cell.get({ index: 5, columnHeader: 'Country' }).click(); |
||||
|
||||
expect(await grid.selectedCount()).toBe(1); |
||||
expect(await grid.cell.verifyCellActiveSelected({ index: 5, columnHeader: 'Country' })); |
||||
}); |
||||
await dashboard.closeAllTabs(); |
||||
|
||||
// FIXME: this is edge case, better be moved to integration tests
|
||||
test('#6 when selection ends on locked field, it still works as expected', async () => { |
||||
// #6 when selection ends on locked field, it still works as expected
|
||||
await dashboard.treeView.openTable({ title: 'Country' }); |
||||
await dashboard.grid.toolbar.fields.toggleShowSystemFields(); |
||||
await grid.selectRange({ |
||||
start: { index: 2, columnHeader: 'City List' }, |
||||
end: { index: 0, columnHeader: 'Country' }, |
||||
}); |
||||
|
||||
expect(await grid.selectedCount()).toBe(12); |
||||
|
||||
await grid.cell.get({ index: 1, columnHeader: 'Country' }).click(); |
||||
|
||||
expect(await grid.selectedCount()).toBe(1); |
||||
expect(await grid.cell.verifyCellActiveSelected({ index: 1, columnHeader: 'Country' })); |
||||
}); |
||||
await dashboard.grid.toolbar.fields.toggleShowSystemFields(); |
||||
await dashboard.closeAllTabs(); |
||||
|
||||
// FIXME: this is edge case, better be moved to integration tests
|
||||
test('#7 when navigated with keyboard, only active cell is affected', async ({ page }) => { |
||||
// #7 when navigated with keyboard, only active cell is affected
|
||||
await dashboard.treeView.openTable({ title: 'Country' }); |
||||
await grid.selectRange({ |
||||
start: { index: 0, columnHeader: 'Country' }, |
||||
end: { index: 2, columnHeader: 'City List' }, |
||||
}); |
||||
|
||||
await page.keyboard.press('ArrowRight'); |
||||
expect(await grid.selectedCount()).toBe(1); |
||||
expect(await grid.cell.verifyCellActiveSelected({ index: 0, columnHeader: 'LastUpdate' })); |
||||
await dashboard.closeAllTabs(); |
||||
}); |
||||
}); |
@ -1,16 +1,16 @@
|
||||
import { expect, test } from '@playwright/test'; |
||||
import { DashboardPage } from '../pages/Dashboard'; |
||||
import { SharedFormPage } from '../pages/SharedForm'; |
||||
import setup from '../setup'; |
||||
import { AccountPage } from '../pages/Account'; |
||||
import { AccountLicensePage } from '../pages/Account/License'; |
||||
import { DashboardPage } from '../../pages/Dashboard'; |
||||
import { SharedFormPage } from '../../pages/SharedForm'; |
||||
import setup from '../../setup'; |
||||
import { AccountPage } from '../../pages/Account'; |
||||
import { AccountLicensePage } from '../../pages/Account/License'; |
||||
|
||||
test.describe('Attachment column', () => { |
||||
let dashboard: DashboardPage; |
||||
let accountLicensePage: AccountLicensePage, accountPage: AccountPage, context: any; |
||||
|
||||
test.beforeEach(async ({ page }) => { |
||||
context = await setup({ page }); |
||||
context = await setup({ page, isEmptyProject: false }); |
||||
dashboard = new DashboardPage(page, context.project); |
||||
accountPage = new AccountPage(page); |
||||
accountLicensePage = new AccountLicensePage(accountPage); |
@ -1,13 +1,13 @@
|
||||
import { test } from '@playwright/test'; |
||||
import { DashboardPage } from '../pages/Dashboard'; |
||||
import setup from '../setup'; |
||||
import { DashboardPage } from '../../pages/Dashboard'; |
||||
import setup from '../../setup'; |
||||
|
||||
test.describe('Virtual columns', () => { |
||||
let dashboard: DashboardPage; |
||||
let context: any; |
||||
|
||||
test.beforeEach(async ({ page }) => { |
||||
context = await setup({ page }); |
||||
context = await setup({ page, isEmptyProject: false }); |
||||
dashboard = new DashboardPage(page, context.project); |
||||
}); |
||||
|
@ -1,15 +1,15 @@
|
||||
import { test } from '@playwright/test'; |
||||
import { DashboardPage } from '../pages/Dashboard'; |
||||
import { GridPage } from '../pages/Dashboard/Grid'; |
||||
import setup from '../setup'; |
||||
import { ToolbarPage } from '../pages/Dashboard/common/Toolbar'; |
||||
import { DashboardPage } from '../../pages/Dashboard'; |
||||
import { GridPage } from '../../pages/Dashboard/Grid'; |
||||
import setup from '../../setup'; |
||||
import { ToolbarPage } from '../../pages/Dashboard/common/Toolbar'; |
||||
|
||||
test.describe('Multi select', () => { |
||||
let dashboard: DashboardPage, grid: GridPage; |
||||
let context: any; |
||||
|
||||
test.beforeEach(async ({ page }) => { |
||||
context = await setup({ page }); |
||||
context = await setup({ page, isEmptyProject: true }); |
||||
dashboard = new DashboardPage(page, context.project); |
||||
grid = dashboard.grid; |
||||
|
@ -1,14 +1,14 @@
|
||||
import { test } from '@playwright/test'; |
||||
import { DashboardPage } from '../pages/Dashboard'; |
||||
import setup from '../setup'; |
||||
import { isPg } from '../setup/db'; |
||||
import { DashboardPage } from '../../pages/Dashboard'; |
||||
import setup from '../../setup'; |
||||
import { isPg } from '../../setup/db'; |
||||
|
||||
test.describe('Relational Columns', () => { |
||||
let dashboard: DashboardPage; |
||||
let context: any; |
||||
|
||||
test.beforeEach(async ({ page }) => { |
||||
context = await setup({ page }); |
||||
context = await setup({ page, isEmptyProject: false }); |
||||
dashboard = new DashboardPage(page, context.project); |
||||
}); |
||||
|
@ -1,15 +1,15 @@
|
||||
import { test } from '@playwright/test'; |
||||
import { DashboardPage } from '../pages/Dashboard'; |
||||
import { GridPage } from '../pages/Dashboard/Grid'; |
||||
import setup from '../setup'; |
||||
import { ToolbarPage } from '../pages/Dashboard/common/Toolbar'; |
||||
import { DashboardPage } from '../../pages/Dashboard'; |
||||
import { GridPage } from '../../pages/Dashboard/Grid'; |
||||
import setup from '../../setup'; |
||||
import { ToolbarPage } from '../../pages/Dashboard/common/Toolbar'; |
||||
|
||||
test.describe('Single select', () => { |
||||
let dashboard: DashboardPage, grid: GridPage; |
||||
let context: any; |
||||
|
||||
test.beforeEach(async ({ page }) => { |
||||
context = await setup({ page }); |
||||
context = await setup({ page, isEmptyProject: true }); |
||||
dashboard = new DashboardPage(page, context.project); |
||||
grid = dashboard.grid; |
||||
|
@ -1,16 +1,16 @@
|
||||
import { expect, test } from '@playwright/test'; |
||||
import { DashboardPage } from '../pages/Dashboard'; |
||||
import { GalleryPage } from '../pages/Dashboard/Gallery'; |
||||
import { GridPage } from '../pages/Dashboard/Grid'; |
||||
import setup from '../setup'; |
||||
import { ToolbarPage } from '../pages/Dashboard/common/Toolbar'; |
||||
import { DashboardPage } from '../../pages/Dashboard'; |
||||
import { GalleryPage } from '../../pages/Dashboard/Gallery'; |
||||
import { GridPage } from '../../pages/Dashboard/Grid'; |
||||
import setup from '../../setup'; |
||||
import { ToolbarPage } from '../../pages/Dashboard/common/Toolbar'; |
||||
|
||||
test.describe('Expanded form URL', () => { |
||||
let dashboard: DashboardPage; |
||||
let context: any; |
||||
|
||||
test.beforeEach(async ({ page }) => { |
||||
context = await setup({ page }); |
||||
context = await setup({ page, isEmptyProject: false }); |
||||
dashboard = new DashboardPage(page, context.project); |
||||
}); |
||||
|
@ -1,8 +1,8 @@
|
||||
import { expect, test } from '@playwright/test'; |
||||
import { DashboardPage } from '../pages/Dashboard'; |
||||
import { ToolbarPage } from '../pages/Dashboard/common/Toolbar'; |
||||
import { FormPage } from '../pages/Dashboard/Form'; |
||||
import setup from '../setup'; |
||||
import { DashboardPage } from '../../pages/Dashboard'; |
||||
import { ToolbarPage } from '../../pages/Dashboard/common/Toolbar'; |
||||
import { FormPage } from '../../pages/Dashboard/Form'; |
||||
import setup from '../../setup'; |
||||
|
||||
// Skip for now as it is not working in CI atm
|
||||
test.describe.skip('Find row by scanner', () => { |
@ -1,9 +1,9 @@
|
||||
import { test } from '@playwright/test'; |
||||
import { airtableApiBase, airtableApiKey } from '../constants'; |
||||
import { DashboardPage } from '../pages/Dashboard'; |
||||
import { quickVerify } from '../quickTests/commonTest'; |
||||
import setup from '../setup'; |
||||
import { isPg, isSqlite } from '../setup/db'; |
||||
import { airtableApiBase, airtableApiKey } from '../../constants'; |
||||
import { DashboardPage } from '../../pages/Dashboard'; |
||||
import { quickVerify } from '../../quickTests/commonTest'; |
||||
import setup from '../../setup'; |
||||
import { isPg, isSqlite } from '../../setup/db'; |
||||
|
||||
test.describe('Import', () => { |
||||
let dashboard: DashboardPage; |
@ -1,5 +1,5 @@
|
||||
import { test } from '@playwright/test'; |
||||
import setup from '../setup'; |
||||
import setup from '../../setup'; |
||||
import { UITypes } from 'nocodb-sdk'; |
||||
import { Api } from 'nocodb-sdk'; |
||||
let api: Api<any>; |
@ -1,13 +1,13 @@
|
||||
import { test } from '@playwright/test'; |
||||
import { DashboardPage } from '../pages/Dashboard'; |
||||
import setup from '../setup'; |
||||
import { DashboardPage } from '../../pages/Dashboard'; |
||||
import setup from '../../setup'; |
||||
|
||||
test.describe('Grid pagination', () => { |
||||
let dashboard: DashboardPage; |
||||
let context: any; |
||||
|
||||
test.beforeEach(async ({ page }) => { |
||||
context = await setup({ page }); |
||||
context = await setup({ page, isEmptyProject: false }); |
||||
dashboard = new DashboardPage(page, context.project); |
||||
}); |
||||
|
@ -1,8 +1,8 @@
|
||||
import { test } from '@playwright/test'; |
||||
import { DashboardPage } from '../pages/Dashboard'; |
||||
import setup from '../setup'; |
||||
import { ToolbarPage } from '../pages/Dashboard/common/Toolbar'; |
||||
import { ProjectsPage } from '../pages/ProjectsPage'; |
||||
import { DashboardPage } from '../../pages/Dashboard'; |
||||
import setup from '../../setup'; |
||||
import { ToolbarPage } from '../../pages/Dashboard/common/Toolbar'; |
||||
import { ProjectsPage } from '../../pages/ProjectsPage'; |
||||
import { Api } from 'nocodb-sdk'; |
||||
|
||||
test.describe('Project operations', () => { |
@ -1,13 +1,13 @@
|
||||
import { test } from '@playwright/test'; |
||||
import { DashboardPage } from '../pages/Dashboard'; |
||||
import setup from '../setup'; |
||||
import { DashboardPage } from '../../pages/Dashboard'; |
||||
import setup from '../../setup'; |
||||
|
||||
test.describe('Super user', () => { |
||||
let dashboard: DashboardPage; |
||||
let context: any; |
||||
|
||||
test.beforeEach(async ({ page }) => { |
||||
context = await setup({ page }); |
||||
context = await setup({ page, isEmptyProject: true }); |
||||
dashboard = new DashboardPage(page, context.project); |
||||
}); |
||||
|
@ -1,7 +1,7 @@
|
||||
import { expect, test } from '@playwright/test'; |
||||
import { DashboardPage } from '../pages/Dashboard'; |
||||
import { GridPage } from '../pages/Dashboard/Grid'; |
||||
import setup from '../setup'; |
||||
import { DashboardPage } from '../../pages/Dashboard'; |
||||
import { GridPage } from '../../pages/Dashboard/Grid'; |
||||
import setup from '../../setup'; |
||||
|
||||
test.describe('Table Column Operations', () => { |
||||
let grid: GridPage, dashboard: DashboardPage; |
@ -1,14 +1,14 @@
|
||||
import { test } from '@playwright/test'; |
||||
import { DashboardPage } from '../pages/Dashboard'; |
||||
import { GridPage } from '../pages/Dashboard/Grid'; |
||||
import setup from '../setup'; |
||||
import { DashboardPage } from '../../pages/Dashboard'; |
||||
import { GridPage } from '../../pages/Dashboard/Grid'; |
||||
import setup from '../../setup'; |
||||
|
||||
test.describe('Table Column Operations', () => { |
||||
let grid: GridPage, dashboard: DashboardPage; |
||||
let context: any; |
||||
|
||||
test.beforeEach(async ({ page }) => { |
||||
context = await setup({ page }); |
||||
context = await setup({ page, isEmptyProject: true }); |
||||
dashboard = new DashboardPage(page, context.project); |
||||
grid = dashboard.grid; |
||||
|
@ -1,14 +1,14 @@
|
||||
import { test } from '@playwright/test'; |
||||
import { DashboardPage } from '../pages/Dashboard'; |
||||
import { SettingsPage, SettingTab } from '../pages/Dashboard/Settings'; |
||||
import setup from '../setup'; |
||||
import { DashboardPage } from '../../pages/Dashboard'; |
||||
import { SettingsPage, SettingTab } from '../../pages/Dashboard/Settings'; |
||||
import setup from '../../setup'; |
||||
|
||||
test.describe('Table Operations', () => { |
||||
let dashboard: DashboardPage, settings: SettingsPage; |
||||
let context: any; |
||||
|
||||
test.beforeEach(async ({ page }) => { |
||||
context = await setup({ page }); |
||||
context = await setup({ page, isEmptyProject: false }); |
||||
dashboard = new DashboardPage(page, context.project); |
||||
settings = dashboard.settings; |
||||
}); |
@ -1,10 +1,10 @@
|
||||
import { expect, Page, test } from '@playwright/test'; |
||||
import { DashboardPage } from '../pages/Dashboard'; |
||||
import setup from '../setup'; |
||||
import { DashboardPage } from '../../pages/Dashboard'; |
||||
import setup from '../../setup'; |
||||
import { Api, UITypes } from 'nocodb-sdk'; |
||||
import { rowMixedValue } from '../setup/xcdb-records'; |
||||
import { GridPage } from '../pages/Dashboard/Grid'; |
||||
import { ToolbarPage } from '../pages/Dashboard/common/Toolbar'; |
||||
import { rowMixedValue } from '../../setup/xcdb-records'; |
||||
import { GridPage } from '../../pages/Dashboard/Grid'; |
||||
import { ToolbarPage } from '../../pages/Dashboard/common/Toolbar'; |
||||
|
||||
let dashboard: DashboardPage, |
||||
grid: GridPage, |
@ -1,14 +1,14 @@
|
||||
import { test } from '@playwright/test'; |
||||
import { DashboardPage } from '../pages/Dashboard'; |
||||
import setup from '../setup'; |
||||
import { isPg } from '../setup/db'; |
||||
import { DashboardPage } from '../../pages/Dashboard'; |
||||
import setup from '../../setup'; |
||||
import { isPg } from '../../setup/db'; |
||||
|
||||
test.describe('Grid view locked', () => { |
||||
let dashboard: DashboardPage; |
||||
let context: any; |
||||
|
||||
test.beforeEach(async ({ page }) => { |
||||
context = await setup({ page }); |
||||
context = await setup({ page, isEmptyProject: false }); |
||||
dashboard = new DashboardPage(page, context.project); |
||||
}); |
||||
|
Loading…
Reference in new issue