Skip to content

[DRAFT]caseyisonit/skip flaky tests #5680

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: ttomar/update-mwr
Choose a base branch
from
Draft
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@adobe/spectrum-web-components",
"version": "0.0.9",
"private": true,
"description": "Spectrum Web Components are a set of reusable, accessible, and customizable web components following the design language of Adobe Spectrum.",
"license": "Apache-2.0",
"author": "Adobe",
Expand All @@ -27,9 +27,9 @@
"build:ts:watch": "wireit",
"build:types": "wireit",
"build:watch": "wireit",
"changeset-snapshot-publish": "yarn prepublishOnly && yarn changeset version --snapshot snapshot && yarn constraints --fix && yarn install --refresh-lockfile && yarn version:update && yarn changeset publish --no-git-tag --tag snapshot",
"changeset-publish": "yarn prepublishOnly && yarn changeset version && yarn constraints --fix && yarn install --refresh-lockfile && yarn version:update && yarn changeset publish --no-git-tag && yarn push-to-remote && yarn create-git-tag && yarn postpublish",
"changelog:global": "node ./scripts/update-global-changelog.js",
"changeset-publish": "yarn prepublishOnly && yarn changeset version && yarn constraints --fix && yarn install --refresh-lockfile && yarn version:update && yarn changeset publish --no-git-tag && yarn push-to-remote && yarn create-git-tag && yarn postpublish",
"changeset-snapshot-publish": "yarn prepublishOnly && yarn changeset version --snapshot snapshot && yarn constraints --fix && yarn install --refresh-lockfile && yarn version:update && yarn changeset publish --no-git-tag --tag snapshot",
"chromatic": "chromatic --build-script-name storybook:build # note that --project-token must be set in your env variables",
"create-git-tag": "node --no-warnings ./scripts/create-git-tag.js",
"custom-element-json": "node ./scripts/custom-element-json.js",
Expand Down Expand Up @@ -199,7 +199,7 @@
"terser": "^4.8.1",
"typescript": "^5.3.3",
"webpack-merge": "^6.0.1",
"wireit": "^0.14.3",
"wireit": "^0.14.12",
"yargs": "^17.2.1"
},
"keywords": [
Expand Down Expand Up @@ -263,7 +263,8 @@
"!tools/**/*.d.ts",
"scripts/build-ts.js",
"packages/**/exports.json",
"tools/**/exports.json"
"tools/**/exports.json",
"test/**/*.ts"
],
"output": [
"packages/**/*.js",
Expand Down
29 changes: 10 additions & 19 deletions packages/action-button/test/action-button.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@
* governing permissions and limitations under the License.
*/

import '@spectrum-web-components/action-button/sp-action-button.js';
import {
ActionButton,
LONGPRESS_DURATION,
} from '@spectrum-web-components/action-button';
import {
aTimeout,
elementUpdated,
Expand All @@ -23,11 +18,18 @@ import {
html,
waitUntil,
} from '@open-wc/testing';
import {
ActionButton,
LONGPRESS_DURATION,
} from '@spectrum-web-components/action-button';
import '@spectrum-web-components/action-button/sp-action-button.js';
import { sendKeys } from '@web/test-runner-commands';
import { spy } from 'sinon';
import { testForLitDevWarnings } from '../../../test/testing-helpers.js';
import {
mouseClickOn,
testForLitDevWarnings,
} from '../../../test/testing-helpers.js';
import { m as BlackActionButton } from '../stories/action-button-black.stories.js';
import { sendMouse } from '../../../test/plugins/browser.js';

describe('ActionButton', () => {
testForLitDevWarnings(
Expand Down Expand Up @@ -313,20 +315,9 @@ describe('ActionButton', () => {
event.preventDefault();
clicked = true;
});
const rect = el.getBoundingClientRect();

// tests mouse click events, and by extension VoiceOver CRTL+Option+Space click
await sendMouse({
steps: [
{
position: [
rect.left + rect.width / 2,
rect.top + rect.height / 2,
],
type: 'click',
},
],
});
await mouseClickOn(el);
await elementUpdated(el);
expect(clicked).to.be.true;
});
Expand Down
60 changes: 18 additions & 42 deletions packages/action-group/test/action-group.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,41 +22,39 @@ import {
} from '@open-wc/testing';

import { ActionButton } from '@spectrum-web-components/action-button';
import { ActionMenu } from '@spectrum-web-components/action-menu';
import { MenuItem } from '@spectrum-web-components/menu';
import '@spectrum-web-components/action-button/sp-action-button.js';
import { ActionGroup } from '@spectrum-web-components/action-group';
import '@spectrum-web-components/action-group/sp-action-group.js';
import { ActionMenu } from '@spectrum-web-components/action-menu';
import '@spectrum-web-components/action-menu/sp-action-menu.js';
import '@spectrum-web-components/menu/sp-menu.js';
import '@spectrum-web-components/menu/sp-menu-item.js';
import '@spectrum-web-components/picker/sp-picker.js';
import {
LitElement,
SpectrumElement,
TemplateResult,
} from '@spectrum-web-components/base';
import { MenuItem } from '@spectrum-web-components/menu';
import '@spectrum-web-components/menu/sp-menu-item.js';
import '@spectrum-web-components/menu/sp-menu.js';
import '@spectrum-web-components/overlay/overlay-trigger.js';
import '@spectrum-web-components/picker/sp-picker.js';
import { isWebKit } from '@spectrum-web-components/shared';
import '@spectrum-web-components/tooltip/sp-tooltip.js';
import { ActionGroup } from '@spectrum-web-components/action-group';
import { sendKeys } from '@web/test-runner-commands';
import sinon, { spy } from 'sinon';
import {
arrowDownEvent,
arrowLeftEvent,
arrowRightEvent,
arrowUpEvent,
endEvent,
homeEvent,
sendMouseFrom,
sendMouseTo,
mouseClickAway,
mouseClickOn,
testForLitDevWarnings,
} from '../../../test/testing-helpers';
import { sendKeys } from '@web/test-runner-commands';
import '@spectrum-web-components/action-group/sp-action-group.js';
import { controlled } from '../stories/action-group-tooltip.stories.js';
import { spy } from 'sinon';
import { sendMouse } from '../../../test/plugins/browser.js';
import { HasActionMenuAsChild } from '../stories/action-group.stories.js';
import '../stories/action-group.stories.js';
import sinon from 'sinon';
import { isWebKit } from '@spectrum-web-components/shared';
import { HasActionMenuAsChild } from '../stories/action-group.stories.js';

class QuietActionGroup extends LitElement {
protected override render(): TemplateResult {
Expand Down Expand Up @@ -272,7 +270,7 @@ describe('ActionGroup', () => {

// get the bounding box of the first button
const firstButton = el.querySelector('#first') as ActionButton;
sendMouseTo(firstButton, 'click');
await mouseClickOn(firstButton);

await elementUpdated(firstButton);

Expand All @@ -295,7 +293,7 @@ describe('ActionGroup', () => {
).to.equal(-1);

// click outside the action-group and it should loose focus and update the tabIndexes
sendMouseFrom(el, 'click');
await mouseClickAway(el);

await elementUpdated(el);

Expand All @@ -322,7 +320,7 @@ describe('ActionGroup', () => {
// get the bounding box of the action-menu
const actionMenu = el.querySelector('#action-menu') as ActionMenu;

sendMouseTo(actionMenu, 'click');
await mouseClickOn(actionMenu);
await waitUntil(
() => actionMenu?.strategy?.overlay?.state === 'opened',
`action-menu opened (status ${actionMenu?.strategy?.overlay?.state})`,
Expand Down Expand Up @@ -905,18 +903,7 @@ describe('ActionGroup', () => {
expect(firstButton.selected, 'first button selected').to.be.true;
expect(secondButton.selected, 'second button not selected').to.be.false;

const rect = icon.getBoundingClientRect();
await sendMouse({
steps: [
{
type: 'click',
position: [
rect.left + rect.width / 2,
rect.top + rect.height / 2,
],
},
],
});
await mouseClickOn(icon);
icon.click();
await elementUpdated(el);

Expand Down Expand Up @@ -1543,18 +1530,7 @@ describe('ActionGroup', () => {

const changeSpy = spy();
test.addEventListener('change', () => changeSpy());
const rect = actionButtons[1].getBoundingClientRect();
sendMouse({
steps: [
{
position: [
rect.left + rect.width / 2,
rect.top + rect.height / 2,
],
type: 'click',
},
],
});
await mouseClickOn(actionButtons[1]);

await aTimeout(500);

Expand Down
8 changes: 3 additions & 5 deletions packages/action-menu/test/action-menu-responsive.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import { ActionMenu } from '@spectrum-web-components/action-menu';
import '@spectrum-web-components/action-menu/sync/sp-action-menu.js';
import '@spectrum-web-components/menu/sp-menu-divider.js';
import '@spectrum-web-components/menu/sp-menu-item.js';
import { spreadProps } from '../../../test/lit-helpers.js';
import { sendMouseTo } from '../../../test/testing-helpers.js';
import { Popover } from '@spectrum-web-components/popover';
import { Tray } from '@spectrum-web-components/tray/src/Tray.js';
import { spreadProps } from '../../../test/lit-helpers.js';
import { mouseClickOn } from '../../../test/testing-helpers.js';

describe('ActionMenu, responsive', () => {
let el: ActionMenu;
Expand Down Expand Up @@ -62,7 +62,7 @@ describe('ActionMenu, responsive', () => {
el.isMobile.matches = true;
el.bindEvents();

sendMouseTo(el.button, 'click');
await mouseClickOn(el.button);

// in this test we only need to wait to see if a tray opens
let tray: Tray | null = null;
Expand All @@ -82,7 +82,6 @@ describe('ActionMenu, responsive', () => {
});

it('is a Popover in desktop', async () => {

el.open = true;

// in this test we only need to wait to see if a popover opens
Expand Down Expand Up @@ -140,7 +139,6 @@ describe('ActionMenu, responsive', () => {
});

it('is a Popover in desktop', async () => {

el.open = true;

// in this test we only need to wait to see if a popover opens
Expand Down
Loading
Loading