From ac283cb283237fa74bf98dbdf5b9271ab95dff51 Mon Sep 17 00:00:00 2001 From: David Little Date: Thu, 5 Dec 2024 21:18:57 -0500 Subject: [PATCH] local tests pass --- package.json | 2 +- test/specs/splitSelections.ux.mts | 43 +++++++++++++++++++++++-------- 2 files changed, 33 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 0df1725..59b2ec4 100644 --- a/package.json +++ b/package.json @@ -482,4 +482,4 @@ "@wdio/spec-reporter": "^8.40.3", "ts-node": "^10.9.2" } -} +} \ No newline at end of file diff --git a/test/specs/splitSelections.ux.mts b/test/specs/splitSelections.ux.mts index 9c937f1..19ba52b 100644 --- a/test/specs/splitSelections.ux.mts +++ b/test/specs/splitSelections.ux.mts @@ -1,7 +1,7 @@ import '@wdio/globals'; import 'wdio-vscode-service'; import {cleanWhitespace, setupEditor, storeCoverageStats} from './utils.mts'; -import {TextEditor} from 'wdio-vscode-service'; +import {sleep, TextEditor} from 'wdio-vscode-service'; describe('Selection splitting', () => { let editor: TextEditor; @@ -12,8 +12,9 @@ describe('Selection splitting', () => { bill phill `); - - await editor.moveCursor(1, 1); + await browser.executeWorkbench(async vscode => { + await vscode.commands.executeCommand('editor.action.selectAll'); + }); } it('can split by string', async () => { @@ -23,14 +24,18 @@ describe('Selection splitting', () => { text: ',', }); }); - + await sleep(100); + await browser.executeWorkbench(async vscode => { + await vscode.commands.executeCommand('cursorRight'); + }); await browser.keys('+'); + expect(await editor.getText()).toEqual( cleanWhitespace(`joe+, boe+, woe moe+,b foe+,c doe+,d bill - phill+ - `) + phill + +`) ); }); @@ -39,6 +44,10 @@ describe('Selection splitting', () => { await browser.executeWorkbench(async vscode => { await vscode.commands.executeCommand('selection-utilities.splitByNewline'); }); + await sleep(100); + await browser.executeWorkbench(async vscode => { + await vscode.commands.executeCommand('cursorRight'); + }); await browser.keys('+'); expect(await editor.getText()).toEqual( @@ -57,14 +66,18 @@ describe('Selection splitting', () => { text: ',[a-z]\\s*', }); }); + await sleep(100); + await browser.executeWorkbench(async vscode => { + await vscode.commands.executeCommand('cursorRight'); + }); await browser.keys('+'); expect(await editor.getText()).toEqual( cleanWhitespace(`joe, boe, woe moe+,b foe+,c doe+,d bill - phill+ - `) + phill + +`) ); }); @@ -75,6 +88,10 @@ describe('Selection splitting', () => { text: 'oe', }); }); + await sleep(100); + await browser.executeWorkbench(async vscode => { + await vscode.commands.executeCommand('cursorRight'); + }); await browser.keys('+'); expect(await editor.getText()).toEqual( @@ -90,14 +107,18 @@ describe('Selection splitting', () => { await setup(); await browser.executeWorkbench(async vscode => { await vscode.commands.executeCommand('selection-utilities.createByRegex', { - text: 'oe', + text: '[a-z]\\s+', }); }); + await sleep(100); + await browser.executeWorkbench(async vscode => { + await vscode.commands.executeCommand('cursorRight'); + }); await browser.keys('+'); expect(await editor.getText()).toEqual( - cleanWhitespace(`joe,+ boe,+ woe - moe,+b foe,+c doe,+d + cleanWhitespace(`joe, boe, woe + moe,b +foe,c +doe,d bill phill `)