|
|
@ -16,6 +16,8 @@ let dashboard: DashboardPage, |
|
|
|
cityTable: any, |
|
|
|
cityTable: any, |
|
|
|
countryTable: any; |
|
|
|
countryTable: any; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const validateResponse = true; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
This change provides undo/redo on multiple actions over UI. |
|
|
|
This change provides undo/redo on multiple actions over UI. |
|
|
|
|
|
|
|
|
|
|
@ -110,12 +112,18 @@ test.describe('Undo Redo', () => { |
|
|
|
|
|
|
|
|
|
|
|
async function undo({ page }: { page: Page }) { |
|
|
|
async function undo({ page }: { page: Page }) { |
|
|
|
const isMac = await grid.isMacOs(); |
|
|
|
const isMac = await grid.isMacOs(); |
|
|
|
await dashboard.grid.waitForResponse({ |
|
|
|
|
|
|
|
uiAction: () => page.keyboard.press(isMac ? 'Meta+z' : 'Control+z'), |
|
|
|
if (validateResponse) { |
|
|
|
httpMethodsToMatch: ['GET'], |
|
|
|
await dashboard.grid.waitForResponse({ |
|
|
|
requestUrlPathToMatch: `/api/v1/db/data/noco/`, |
|
|
|
uiAction: () => page.keyboard.press(isMac ? 'Meta+z' : 'Control+z'), |
|
|
|
responseJsonMatcher: json => json.pageInfo, |
|
|
|
httpMethodsToMatch: ['GET'], |
|
|
|
}); |
|
|
|
requestUrlPathToMatch: `/api/v1/db/data/noco/`, |
|
|
|
|
|
|
|
responseJsonMatcher: json => json.pageInfo, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
await page.keyboard.press(isMac ? 'Meta+z' : 'Control+z'); |
|
|
|
|
|
|
|
await page.waitForTimeout(100); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
test('Row: Create, Update, Delete', async ({ page }) => { |
|
|
|
test('Row: Create, Update, Delete', async ({ page }) => { |
|
|
@ -198,6 +206,14 @@ test.describe('Undo Redo', () => { |
|
|
|
// Undo : hide Decimal
|
|
|
|
// Undo : hide Decimal
|
|
|
|
await undo({ page }); |
|
|
|
await undo({ page }); |
|
|
|
await verifyFieldsOrder(['Number', 'Decimal', 'Currency']); |
|
|
|
await verifyFieldsOrder(['Number', 'Decimal', 'Currency']); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// reorder test
|
|
|
|
|
|
|
|
await toolbar.fields.dragDropFields({ from: 1, to: 0 }); |
|
|
|
|
|
|
|
await verifyFieldsOrder(['Number', 'Currency', 'Decimal']); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Undo : reorder
|
|
|
|
|
|
|
|
await undo({ page }); |
|
|
|
|
|
|
|
await verifyFieldsOrder(['Number', 'Decimal', 'Currency']); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|