Skip to content

Commit

Permalink
test: create @vaadin/test-runner-commands
Browse files Browse the repository at this point in the history
  • Loading branch information
vursen committed Jan 20, 2025
1 parent 6255a51 commit e8c4e28
Show file tree
Hide file tree
Showing 233 changed files with 250 additions and 170 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"groups": [
[
// Testing tools group
"^(@web|@vaadin/chai-plugins|@vaadin/testing-helpers|sinon)",
"^(@web|@vaadin/chai-plugins|@vaadin/test-runner-commands|@vaadin/testing-helpers|sinon)",
// Side-effects group
"^\\u0000",
// External group
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
"@web/dev-server": "^0.4.3",
"@web/dev-server-esbuild": "^1.0.2",
"@web/rollup-plugin-html": "^2.0.0",
"@web/test-runner": "^0.19.0",
"@web/test-runner-commands": "^0.9.0",
"@web/test-runner": "^0.19.0" ,
"@web/test-runner-playwright": "^0.11.0",
"@web/test-runner-puppeteer": "^0.17.0",
"@web/test-runner-saucelabs": "^0.11.2",
Expand Down
1 change: 1 addition & 0 deletions packages/a11y-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
},
"devDependencies": {
"@vaadin/chai-plugins": "24.7.0-alpha6",
"@vaadin/test-runner-commands": "24.7.0-alpha6",
"@vaadin/testing-helpers": "^1.1.0",
"sinon": "^18.0.0"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/a11y-base/test/active-mixin.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from '@vaadin/chai-plugins';
import { sendKeys } from '@vaadin/test-runner-commands';
import { fixtureSync, isIOS, mousedown, mouseup, touchend, touchstart } from '@vaadin/testing-helpers';
import { sendKeys } from '@web/test-runner-commands';
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
import { ActiveMixin } from '../src/active-mixin.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/a11y-base/test/focus-trap-controller.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from '@vaadin/chai-plugins';
import { sendKeys } from '@vaadin/test-runner-commands';
import { fixtureSync } from '@vaadin/testing-helpers';
import { sendKeys } from '@web/test-runner-commands';
import sinon from 'sinon';
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/a11y-base/test/keyboard-mixin.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from '@vaadin/chai-plugins';
import { sendKeys } from '@vaadin/test-runner-commands';
import { fixtureSync } from '@vaadin/testing-helpers';
import { sendKeys } from '@web/test-runner-commands';
import sinon from 'sinon';
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
import { KeyboardMixin } from '../src/keyboard-mixin.js';
Expand Down
1 change: 1 addition & 0 deletions packages/accordion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
},
"devDependencies": {
"@vaadin/chai-plugins": "24.7.0-alpha6",
"@vaadin/test-runner-commands": "24.7.0-alpha6",
"@vaadin/testing-helpers": "^1.1.0",
"sinon": "^18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/accordion/test/accordion-panel.common.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from '@vaadin/chai-plugins';
import { sendKeys } from '@vaadin/test-runner-commands';
import { click, fixtureSync, nextRender, nextUpdate } from '@vaadin/testing-helpers';
import { sendKeys } from '@web/test-runner-commands';
import sinon from 'sinon';

describe('vaadin-accordion-panel', () => {
Expand Down
1 change: 1 addition & 0 deletions packages/app-layout/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
},
"devDependencies": {
"@vaadin/chai-plugins": "24.7.0-alpha6",
"@vaadin/test-runner-commands": "24.7.0-alpha6",
"@vaadin/testing-helpers": "^1.1.0",
"sinon": "^18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/app-layout/test/dom/app-layout.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from '@vaadin/chai-plugins';
import { setViewport } from '@vaadin/test-runner-commands';
import { fixtureSync, nextRender } from '@vaadin/testing-helpers';
import { setViewport } from '@web/test-runner-commands';
import '../../src/vaadin-app-layout.js';
import '../../vaadin-drawer-toggle.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/app-layout/test/helpers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sendKeys } from '@web/test-runner-commands';
import { sendKeys } from '@vaadin/test-runner-commands';

export async function esc() {
await sendKeys({ press: 'Escape' });
Expand Down
2 changes: 1 addition & 1 deletion packages/app-layout/test/keyboard-desktop.common.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from '@vaadin/chai-plugins';
import { setViewport } from '@vaadin/test-runner-commands';
import { fixtureSync, nextFrame, nextRender } from '@vaadin/testing-helpers';
import { setViewport } from '@web/test-runner-commands';
import { tab } from './helpers.js';

describe('desktop navigation', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/app-layout/test/keyboard-mobile.common.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from '@vaadin/chai-plugins';
import { setViewport } from '@vaadin/test-runner-commands';
import { fixtureSync, nextFrame, nextRender } from '@vaadin/testing-helpers';
import { setViewport } from '@web/test-runner-commands';
import { esc, shiftTab, tab } from './helpers.js';

describe('mobile navigation', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/app-layout/test/visual/lumo/app-layout.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { executeServerCommand } from '@vaadin/test-runner-commands';
import { fixtureSync } from '@vaadin/testing-helpers/dist/fixture.js';
import { executeServerCommand } from '@web/test-runner-commands';
import { visualDiff } from '@web/test-runner-visual-regression';
import '../../../theme/lumo/vaadin-app-layout.js';
import '../../../theme/lumo/vaadin-drawer-toggle.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { executeServerCommand } from '@vaadin/test-runner-commands';
import { fixtureSync } from '@vaadin/testing-helpers/dist/fixture.js';
import { executeServerCommand } from '@web/test-runner-commands';
import { visualDiff } from '@web/test-runner-visual-regression';
import '../../../theme/material/vaadin-app-layout.js';
import '../../../theme/material/vaadin-drawer-toggle.js';
Expand Down
1 change: 1 addition & 0 deletions packages/avatar-group/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
},
"devDependencies": {
"@vaadin/chai-plugins": "24.7.0-alpha6",
"@vaadin/test-runner-commands": "24.7.0-alpha6",
"@vaadin/testing-helpers": "^1.1.0",
"sinon": "^18.0.0"
},
Expand Down
1 change: 1 addition & 0 deletions packages/avatar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
},
"devDependencies": {
"@vaadin/chai-plugins": "24.7.0-alpha6",
"@vaadin/test-runner-commands": "24.7.0-alpha6",
"@vaadin/testing-helpers": "^1.1.0",
"sinon": "^18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/avatar/test/visual/lumo/avatar.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { sendKeys } from '@vaadin/test-runner-commands';
import { fixtureSync } from '@vaadin/testing-helpers/dist/fixture.js';
import { sendKeys } from '@web/test-runner-commands';
import { visualDiff } from '@web/test-runner-visual-regression';
import '@vaadin/tooltip/test/not-animated-styles.js';
import '../../../theme/lumo/vaadin-avatar.js';
Expand Down
1 change: 1 addition & 0 deletions packages/board/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
},
"devDependencies": {
"@vaadin/chai-plugins": "24.7.0-alpha6",
"@vaadin/test-runner-commands": "24.7.0-alpha6",
"@vaadin/testing-helpers": "^1.1.0",
"sinon": "^18.0.0"
},
Expand Down
1 change: 1 addition & 0 deletions packages/button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
},
"devDependencies": {
"@vaadin/chai-plugins": "24.7.0-alpha6",
"@vaadin/test-runner-commands": "24.7.0-alpha6",
"@vaadin/icon": "24.7.0-alpha6",
"@vaadin/testing-helpers": "^1.1.0",
"sinon": "^18.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/button/test/button.common.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from '@vaadin/chai-plugins';
import { sendKeys } from '@vaadin/test-runner-commands';
import { fixtureSync, nextRender, nextUpdate } from '@vaadin/testing-helpers';
import { sendKeys } from '@web/test-runner-commands';
import sinon from 'sinon';
import type { Button } from '../vaadin-button.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/button/test/dom/button.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from '@vaadin/chai-plugins';
import { sendKeys } from '@vaadin/test-runner-commands';
import { fixtureSync, mousedown } from '@vaadin/testing-helpers';
import { sendKeys } from '@web/test-runner-commands';
import '../../src/vaadin-button.js';

describe('vaadin-button', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/button/test/visual/helpers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { resetMouse, sendMouse } from '@web/test-runner-commands';
import { resetMouse, sendMouse } from '@vaadin/test-runner-commands';

export async function hover(element) {
const rect = element.getBoundingClientRect();
Expand Down
4 changes: 2 additions & 2 deletions packages/button/test/visual/lumo/button.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { sendKeys } from '@vaadin/test-runner-commands';
import { fixtureSync, mousedown } from '@vaadin/testing-helpers';
import { sendKeys } from '@web/test-runner-commands';
import { visualDiff } from '@web/test-runner-visual-regression';
import '@vaadin/icon/theme/lumo/vaadin-icon.js';
import '@vaadin/vaadin-lumo-styles/vaadin-iconset.js';
Expand Down Expand Up @@ -46,7 +46,7 @@ describe('button', () => {
const wrapper = fixtureSync(`
<div style="display: flex; align-items: baseline; gap: 20px; width: 400px">
<vaadin-button>This is a button</vaadin-button>
<span style="flex-basis: 100%; background-color: #eee;">Sibling</span>
</div>
`);
Expand Down
4 changes: 2 additions & 2 deletions packages/button/test/visual/material/button.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { sendKeys } from '@vaadin/test-runner-commands';
import { fixtureSync } from '@vaadin/testing-helpers/dist/fixture.js';
import { sendKeys } from '@web/test-runner-commands';
import { visualDiff } from '@web/test-runner-visual-regression';
import '@vaadin/icon/theme/material/vaadin-icon.js';
import '@vaadin/vaadin-lumo-styles/vaadin-iconset.js';
Expand Down Expand Up @@ -41,7 +41,7 @@ describe('button', () => {
const wrapper = fixtureSync(`
<div style="display: flex; align-items: baseline; gap: 20px; width: 400px">
<vaadin-button>This is a button</vaadin-button>
<span style="flex-basis: 100%; background-color: #eee;">Sibling</span>
</div>
`);
Expand Down
1 change: 1 addition & 0 deletions packages/card/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
},
"devDependencies": {
"@vaadin/chai-plugins": "24.7.0-alpha6",
"@vaadin/test-runner-commands": "24.7.0-alpha6",
"@vaadin/testing-helpers": "^1.1.0",
"sinon": "^18.0.0"
},
Expand Down
1 change: 1 addition & 0 deletions packages/charts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
},
"devDependencies": {
"@vaadin/chai-plugins": "24.7.0-alpha6",
"@vaadin/test-runner-commands": "24.7.0-alpha6",
"@vaadin/testing-helpers": "^1.1.0",
"sinon": "^18.0.0"
},
Expand Down
1 change: 1 addition & 0 deletions packages/checkbox-group/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
},
"devDependencies": {
"@vaadin/chai-plugins": "24.7.0-alpha6",
"@vaadin/test-runner-commands": "24.7.0-alpha6",
"@vaadin/testing-helpers": "^1.1.0",
"sinon": "^18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/checkbox-group/test/checkbox-group.common.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from '@vaadin/chai-plugins';
import { sendKeys } from '@vaadin/test-runner-commands';
import { fixtureSync, nextFrame } from '@vaadin/testing-helpers';
import { sendKeys } from '@web/test-runner-commands';
import sinon from 'sinon';

describe('vaadin-checkbox-group', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/checkbox-group/test/validation.common.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from '@vaadin/chai-plugins';
import { sendKeys } from '@vaadin/test-runner-commands';
import { fixtureSync, nextFrame, nextRender, nextUpdate } from '@vaadin/testing-helpers';
import { sendKeys } from '@web/test-runner-commands';
import sinon from 'sinon';

describe('validation', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { sendKeys } from '@vaadin/test-runner-commands';
import { fixtureSync } from '@vaadin/testing-helpers/dist/fixture.js';
import { sendKeys } from '@web/test-runner-commands';
import { visualDiff } from '@web/test-runner-visual-regression';
import '../common.js';
import '../../../theme/lumo/vaadin-checkbox-group.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { sendKeys } from '@vaadin/test-runner-commands';
import { fixtureSync } from '@vaadin/testing-helpers/dist/fixture.js';
import { sendKeys } from '@web/test-runner-commands';
import { visualDiff } from '@web/test-runner-visual-regression';
import '../common.js';
import '../../../theme/material/vaadin-checkbox-group.js';
Expand Down
1 change: 1 addition & 0 deletions packages/checkbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
},
"devDependencies": {
"@vaadin/chai-plugins": "24.7.0-alpha6",
"@vaadin/test-runner-commands": "24.7.0-alpha6",
"@vaadin/testing-helpers": "^1.1.0",
"sinon": "^18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/checkbox/test/checkbox.common.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from '@vaadin/chai-plugins';
import { resetMouse, sendKeys, sendMouse } from '@vaadin/test-runner-commands';
import { fixtureSync, mousedown, mouseup, nextFrame, nextRender, nextUpdate } from '@vaadin/testing-helpers';
import { resetMouse, sendKeys, sendMouse } from '@web/test-runner-commands';
import sinon from 'sinon';

describe('checkbox', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/checkbox/test/validation.common.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from '@vaadin/chai-plugins';
import { sendKeys } from '@vaadin/test-runner-commands';
import { fixtureSync, nextFrame, nextRender } from '@vaadin/testing-helpers';
import { sendKeys } from '@web/test-runner-commands';
import sinon from 'sinon';

describe('validation', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/checkbox/test/visual/lumo/checkbox.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { sendKeys } from '@vaadin/test-runner-commands';
import { fixtureSync } from '@vaadin/testing-helpers';
import { sendKeys } from '@web/test-runner-commands';
import { visualDiff } from '@web/test-runner-visual-regression';
import '@vaadin/vaadin-lumo-styles/test/autoload.js';
import '../common.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/checkbox/test/visual/material/checkbox.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { sendKeys } from '@vaadin/test-runner-commands';
import { fixtureSync } from '@vaadin/testing-helpers';
import { sendKeys } from '@web/test-runner-commands';
import { visualDiff } from '@web/test-runner-visual-regression';
import '../common.js';
import '../../../theme/material/vaadin-checkbox.js';
Expand Down
1 change: 1 addition & 0 deletions packages/combo-box/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
},
"devDependencies": {
"@vaadin/chai-plugins": "24.7.0-alpha6",
"@vaadin/test-runner-commands": "24.7.0-alpha6",
"@vaadin/testing-helpers": "^1.1.0",
"@vaadin/text-field": "24.7.0-alpha6",
"sinon": "^18.0.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from '@vaadin/chai-plugins';
import { sendKeys } from '@vaadin/test-runner-commands';
import { fixtureSync, nextRender } from '@vaadin/testing-helpers';
import { sendKeys } from '@web/test-runner-commands';
import sinon from 'sinon';

describe('vaadin-combo-box-light - validation', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/combo-box/test/combo-box-light.common.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect } from '@vaadin/chai-plugins';
import { sendKeys } from '@vaadin/test-runner-commands';
import {
arrowDownKeyDown,
click,
Expand All @@ -12,7 +13,6 @@ import {
touchend,
touchstart,
} from '@vaadin/testing-helpers';
import { sendKeys } from '@web/test-runner-commands';
import sinon from 'sinon';
import '@vaadin/text-field/vaadin-text-field.js';
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/combo-box/test/interactions.common.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect } from '@vaadin/chai-plugins';
import { resetMouse, sendKeys, sendMouse } from '@vaadin/test-runner-commands';
import {
aTimeout,
click,
Expand All @@ -13,7 +14,6 @@ import {
tap,
touchstart,
} from '@vaadin/testing-helpers';
import { resetMouse, sendKeys, sendMouse } from '@web/test-runner-commands';
import sinon from 'sinon';
import { isTouch } from '@vaadin/component-base/src/browser-utils.js';
import { getFirstItem, setInputValue } from './helpers.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/combo-box/test/keyboard.common.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect } from '@vaadin/chai-plugins';
import { sendKeys } from '@vaadin/test-runner-commands';
import {
arrowDownKeyDown,
arrowUpKeyDown,
Expand All @@ -10,7 +11,6 @@ import {
nextFrame,
nextRender,
} from '@vaadin/testing-helpers';
import { sendKeys } from '@web/test-runner-commands';
import sinon from 'sinon';
import { getViewportItems, getVisibleItemsCount, scrollToIndex, setInputValue } from './helpers.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/combo-box/test/validation.common.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from '@vaadin/chai-plugins';
import { sendKeys } from '@vaadin/test-runner-commands';
import { fixtureSync, nextRender, nextUpdate, outsideClick } from '@vaadin/testing-helpers';
import { sendKeys } from '@web/test-runner-commands';
import sinon from 'sinon';

describe('validation', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/combo-box/test/visual/lumo/combo-box.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { sendKeys, sendMouse } from '@vaadin/test-runner-commands';
import { fixtureSync, mousedown, nextFrame } from '@vaadin/testing-helpers';
import { sendKeys, sendMouse } from '@web/test-runner-commands';
import { visualDiff } from '@web/test-runner-visual-regression';
import '../common.js';
import '../../../theme/lumo/vaadin-combo-box.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/combo-box/test/visual/material/combo-box.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { sendKeys } from '@vaadin/test-runner-commands';
import { fixtureSync } from '@vaadin/testing-helpers/dist/fixture.js';
import { sendKeys } from '@web/test-runner-commands';
import { visualDiff } from '@web/test-runner-visual-regression';
import '../common.js';
import '../../../theme/material/vaadin-combo-box.js';
Expand Down
1 change: 1 addition & 0 deletions packages/component-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
},
"devDependencies": {
"@vaadin/chai-plugins": "24.7.0-alpha6",
"@vaadin/test-runner-commands": "24.7.0-alpha6",
"@vaadin/testing-helpers": "^1.1.0",
"sinon": "^18.0.0"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from '@vaadin/chai-plugins';
import { sendKeys } from '@vaadin/test-runner-commands';
import { fixtureSync, mousedown, mouseup, nextFrame } from '@vaadin/testing-helpers';
import { sendKeys } from '@web/test-runner-commands';
import sinon from 'sinon';
import { Virtualizer } from '../src/virtualizer.js';

Expand Down
Loading

0 comments on commit e8c4e28

Please sign in to comment.