mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) finish porting test/browser/*.test.js tests
Summary: This finishes porting the bulk of tests relying on the old selenium pseudo-promise manager. Here the remaining ones that I know of: * There are some tests written in typescript at test/browser/*.test.ts (I've olny been looking at the older *.test.js ones so far) * There are some tests in test/home that run a slightly different way First version of this diff just had renames, so for reviewing it is likely easiest to switch to a comparison of that version with the final version. I switched from using test.(describe/it/...) to straight mocha since the indirection was confusing mocha-webdriver's debug functions (e.g. it was misnaming screenshots). That resulted in a lot of noise in the diff, sorry! Some tests fail in headless operation in modern chrome for what looks to be the same reason as https://github.com/gristlabs/grist-core/pull/490 (some copy/paste nuance or change). Test Plan: test porting Reviewers: georgegevoian Reviewed By: georgegevoian Differential Revision: https://phab.getgrist.com/D3862
This commit is contained in:
parent
1d93923efe
commit
d6abe6a737
@ -12,7 +12,7 @@ describe('DocTutorial', function () {
|
|||||||
let api: UserAPI;
|
let api: UserAPI;
|
||||||
let session: gu.Session;
|
let session: gu.Session;
|
||||||
|
|
||||||
const cleanup = setupTestSuite();
|
const cleanup = setupTestSuite({team: true});
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
session = await gu.session().teamSite.user('support').login();
|
session = await gu.session().teamSite.user('support').login();
|
||||||
|
@ -543,10 +543,11 @@ export async function rightClick(cell: WebElement) {
|
|||||||
* section. RowNum is a 1-based number as in the row headers, and col is a 0-based index for
|
* section. RowNum is a 1-based number as in the row headers, and col is a 0-based index for
|
||||||
* grid view or field name for detail view.
|
* grid view or field name for detail view.
|
||||||
*/
|
*/
|
||||||
export async function getCursorPosition(section?: WebElement) {
|
export async function getCursorPosition(section?: WebElement|string) {
|
||||||
return await retryOnStale(async () => {
|
return await retryOnStale(async () => {
|
||||||
|
if (typeof section === 'string') { section = await getSection(section); }
|
||||||
section = section ?? await driver.findWait('.active_section', 4000);
|
section = section ?? await driver.findWait('.active_section', 4000);
|
||||||
const cursor = await section.findWait('.active_cursor', 1000);
|
const cursor = await section.findWait('.selected_cursor', 1000);
|
||||||
// Query assuming the cursor is in a GridView and a DetailView, then use whichever query data
|
// Query assuming the cursor is in a GridView and a DetailView, then use whichever query data
|
||||||
// works out.
|
// works out.
|
||||||
const [colIndex, rowIndex, rowNum, colName] = await Promise.all([
|
const [colIndex, rowIndex, rowNum, colName] = await Promise.all([
|
||||||
|
Loading…
Reference in New Issue
Block a user