Skip to content
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

chore (v8-vr-tests): Remove usage of Screener #25979

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions apps/vr-tests/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,3 @@ setAddon({
});

export const parameters = { layout: 'none' };

// For static storybook per https://github.com/screener-io/screener-storybook#testing-with-static-storybook-app
if (typeof window === 'object') {
/** @type {*} */ (window).__screener_storybook__ = require('@storybook/react').getStorybook;
}
2 changes: 0 additions & 2 deletions apps/vr-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"just": "just-scripts",
"lint": "just-scripts lint",
"screener:build": "cross-env NODE_OPTIONS=--max-old-space-size=3072 just-scripts storybook:build",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

screener:build will be renamed in a separate PR along with other miscellaneous changes

"screener": "just-scripts screener",
"start": "just-scripts dev:storybook",
"type-check": "tsc"
},
Expand All @@ -31,7 +30,6 @@
"@fluentui/storybook": "^1.0.0",
"react": "17.0.2",
"react-dom": "17.0.2",
"screener-storybook": "0.23.0",
"tslib": "^2.1.0"
}
}
53 changes: 0 additions & 53 deletions apps/vr-tests/screener.config.js

This file was deleted.

6 changes: 3 additions & 3 deletions apps/vr-tests/src/stories/ActivityItem.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import Screener, { Steps } from 'screener-storybook/src/screener';
import { StoryWright, Steps } from 'storywright';
import { storiesOf } from '@storybook/react';
import { TestWrapperDecorator } from '../utilities/index';
import { ActivityItem, Icon } from '@fluentui/react';
Expand All @@ -8,13 +8,13 @@ storiesOf('ActivityItem', module)
.addDecorator(TestWrapperDecorator)
.addDecorator(story =>
// prettier-ignore
<Screener
<StoryWright
steps={new Steps()
.snapshot('default', { cropTo: '.testWrapper' })
.end()}
>
{story()}
</Screener>,
</StoryWright>,
)
.addStory(
'Root',
Expand Down
14 changes: 7 additions & 7 deletions apps/vr-tests/src/stories/Breadcrumb.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import Screener from 'screener-storybook/src/screener';
import { StoryWright, Steps } from 'storywright';
import { storiesOf } from '@storybook/react';
import { TestWrapperDecoratorTall } from '../utilities/index';
import { Breadcrumb } from '@fluentui/react';
Expand All @@ -9,8 +9,8 @@ const noOp = () => undefined;
storiesOf('Breadcrumb', module)
.addDecorator(TestWrapperDecoratorTall)
.addDecorator(story => (
<Screener
steps={new Screener.Steps()
<StoryWright
steps={new Steps()
.snapshot('default', { cropTo: '.testWrapper' })
.executeScript(
"document.getElementsByClassName('testWrapper')[0].classList.add('ms-Fabric--isFocusVisible')",
Expand All @@ -35,7 +35,7 @@ storiesOf('Breadcrumb', module)
.end()}
>
{story()}
</Screener>
</StoryWright>
))
.addStory(
'Root',
Expand Down Expand Up @@ -76,8 +76,8 @@ storiesOf('Breadcrumb', module)
storiesOf('Breadcrumb', module)
.addDecorator(TestWrapperDecoratorTall)
.addDecorator(story => (
<Screener
steps={new Screener.Steps()
<StoryWright
steps={new Steps()
.hover('.ms-Breadcrumb-list li:nth-child(2)')
.snapshot('actionable hover', { cropTo: '.testWrapper' })
.hover('.ms-Breadcrumb-list li:nth-child(3)')
Expand All @@ -92,7 +92,7 @@ storiesOf('Breadcrumb', module)
.end()}
>
{story()}
</Screener>
</StoryWright>
))
.addStory('Hovering items', () => (
<Breadcrumb
Expand Down
30 changes: 15 additions & 15 deletions apps/vr-tests/src/stories/Button.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import Screener, { Steps } from 'screener-storybook/src/screener';
import { StoryWright, Steps } from 'storywright';
import { storiesOf } from '@storybook/react';
import { TestWrapperDecorator, TestWrapperDecoratorTall } from '../utilities/index';
import {
Expand Down Expand Up @@ -47,7 +47,7 @@ const commandProps: IButtonProps = {
storiesOf('Button (compat)', module)
.addDecorator(TestWrapperDecorator)
.addDecorator(story => (
<Screener
<StoryWright
steps={new Steps()
.snapshot('default', { cropTo: '.testWrapper' })
.hover('.ms-Button')
Expand All @@ -57,7 +57,7 @@ storiesOf('Button (compat)', module)
.end()}
>
{story()}
</Screener>
</StoryWright>
))
.addStory('Root', () => <DefaultButton {...baseProps} />, { includeRtl: true })
.addStory('Disabled', () => <DefaultButton {...baseProps} disabled={true} />)
Expand All @@ -78,7 +78,7 @@ storiesOf('Button (compat)', module)
storiesOf('Button Action (compat)', module)
.addDecorator(TestWrapperDecorator)
.addDecorator(story => (
<Screener
<StoryWright
steps={new Steps()
.snapshot('default', { cropTo: '.testWrapper' })
.hover('.ms-Button')
Expand All @@ -88,7 +88,7 @@ storiesOf('Button Action (compat)', module)
.end()}
>
{story()}
</Screener>
</StoryWright>
))
.addStory('Root', () => <ActionButton {...baseProps} />, { includeRtl: true })
.addStory('Disabled', () => <ActionButton {...baseProps} disabled={true} />)
Expand All @@ -99,7 +99,7 @@ storiesOf('Button Action (compat)', module)
storiesOf('Button Compound (compat)', module)
.addDecorator(TestWrapperDecorator)
.addDecorator(story => (
<Screener
<StoryWright
steps={new Steps()
.snapshot('default', { cropTo: '.testWrapper' })
.hover('.ms-Button')
Expand All @@ -109,7 +109,7 @@ storiesOf('Button Compound (compat)', module)
.end()}
>
{story()}
</Screener>
</StoryWright>
))
.addStory('Root', () => <CompoundButton {...baseProps} />, { includeRtl: true })
.addStory('Disabled', () => <CompoundButton {...baseProps} disabled={true} />)
Expand All @@ -129,7 +129,7 @@ storiesOf('Button Command (compat)', module)
))
.addDecorator(TestWrapperDecoratorTall)
.addDecorator(story => (
<Screener
<StoryWright
steps={new Steps()
.snapshot('default', { cropTo: '.testWrapper' })
.hover('.ms-Button')
Expand All @@ -142,7 +142,7 @@ storiesOf('Button Command (compat)', module)
.end()}
>
{story()}
</Screener>
</StoryWright>
))
.addStory('Root', () => <CommandBarButton {...commandProps} />, { includeRtl: true })
.addStory('Disabled', () => <CommandBarButton {...commandProps} disabled={true} />)
Expand All @@ -151,7 +151,7 @@ storiesOf('Button Command (compat)', module)
storiesOf('Button Split (compat)', module)
.addDecorator(TestWrapperDecoratorTall)
.addDecorator(story => (
<Screener
<StoryWright
steps={new Steps()
.snapshot('default', { cropTo: '.testWrapper' })
.hover('.ms-Button:nth-child(1)')
Expand All @@ -170,7 +170,7 @@ storiesOf('Button Split (compat)', module)
.end()}
>
{story()}
</Screener>
</StoryWright>
))
.addStory('Root', () => <DefaultButton {...commandProps} split={true} />, { includeRtl: true })
.addStory('Disabled', () => <DefaultButton {...commandProps} disabled={true} split={true} />)
Expand All @@ -193,9 +193,9 @@ storiesOf('Button Split (compat)', module)
storiesOf('Button Special Scenarios (compat)', module)
.addDecorator(TestWrapperDecorator)
.addDecorator(story => (
<Screener steps={new Steps().snapshot('default', { cropTo: '.testWrapper' }).end()}>
<StoryWright steps={new Steps().snapshot('default', { cropTo: '.testWrapper' }).end()}>
{story()}
</Screener>
</StoryWright>
))

.addStory('primary with placeholder', () => (
Expand Down Expand Up @@ -226,15 +226,15 @@ storiesOf('Button Special Scenarios (compat)', module)
storiesOf('IconButton Scenarios (compat)', module)
.addDecorator(TestWrapperDecorator)
.addDecorator(story => (
<Screener
<StoryWright
steps={new Steps()
.snapshot('icon', { cropTo: '.testWrapper' })
.hover('.ms-Button')
.snapshot('hover icon', { cropTo: '.testWrapper' })
.end()}
>
{story()}
</Screener>
</StoryWright>
))

.addStory('normal icon button', () => (
Expand Down
10 changes: 5 additions & 5 deletions apps/vr-tests/src/stories/Calendar.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import Screener from 'screener-storybook/src/screener';
import { StoryWright, Steps } from 'storywright';
import { storiesOf } from '@storybook/react';
import { TestWrapperDecoratorFixedWidth } from '../utilities/index';
import { Fabric, Calendar, DateRangeType, DayOfWeek } from '@fluentui/react';
Expand All @@ -8,9 +8,9 @@ const date = new Date(2010, 1, 12);
storiesOf('Calendar', module)
.addDecorator(TestWrapperDecoratorFixedWidth)
.addDecorator(story => (
<Screener steps={new Screener.Steps().snapshot('default', { cropTo: '.testWrapper' }).end()}>
<StoryWright steps={new Steps().snapshot('default', { cropTo: '.testWrapper' }).end()}>
{story()}
</Screener>
</StoryWright>
))
.addStory(
'Root',
Expand All @@ -25,9 +25,9 @@ storiesOf('Calendar', module)
storiesOf('Calendar - No Month Option', module)
.addDecorator(TestWrapperDecoratorFixedWidth)
.addDecorator(story => (
<Screener steps={new Screener.Steps().snapshot('default', { cropTo: '.testWrapper' }).end()}>
<StoryWright steps={new Steps().snapshot('default', { cropTo: '.testWrapper' }).end()}>
{story()}
</Screener>
</StoryWright>
))
.addStory('Show Month as Overlay and no Go To Today', () => (
<Fabric>
Expand Down
14 changes: 7 additions & 7 deletions apps/vr-tests/src/stories/Checkbox.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import Screener from 'screener-storybook/src/screener';
import { StoryWright, Steps } from 'storywright';
import { storiesOf } from '@storybook/react';
import { TestWrapperDecorator } from '../utilities/index';
import { Checkbox, Persona, PersonaSize } from '@fluentui/react';
Expand All @@ -8,13 +8,13 @@ storiesOf('Checkbox', module)
.addDecorator(TestWrapperDecorator)
.addDecorator(story =>
// prettier-ignore
<Screener
steps={new Screener.Steps()
<StoryWright
steps={new Steps()
.snapshot('default', { cropTo: '.testWrapper' })
.end()}
>
{story()}
</Screener>,
</StoryWright>,
)
.addStory('Unchecked', () => <Checkbox label="Unchecked checkbox" />, { includeRtl: true })
.addStory('Checked', () => <Checkbox label="Checked checkbox" checked />)
Expand Down Expand Up @@ -55,8 +55,8 @@ storiesOf('Checkbox Indeterminate', module)
.addDecorator(TestWrapperDecorator)
.addDecorator(story =>
// prettier-ignore
<Screener
steps={new Screener.Steps()
<StoryWright
steps={new Steps()
.snapshot('default', { cropTo: '.testWrapper' })
.hover('.ms-Checkbox')
.snapshot('hover', { cropTo: '.testWrapper' })
Expand All @@ -65,7 +65,7 @@ storiesOf('Checkbox Indeterminate', module)
.end()}
>
{story()}
</Screener>,
</StoryWright>,
)
.addStory('Uncontrolled Indeterminate checkbox', () => (
<Checkbox label="Uncontrolled Indeterminate checkbox" defaultIndeterminate />
Expand Down
8 changes: 4 additions & 4 deletions apps/vr-tests/src/stories/ChoiceGroup.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import Screener from 'screener-storybook/src/screener';
import { StoryWright, Steps } from 'storywright';
import { storiesOf } from '@storybook/react';
import { TestWrapperDecorator } from '../utilities/index';
import { ChoiceGroup, IChoiceGroupOption } from '@fluentui/react';
Expand All @@ -14,8 +14,8 @@ const options: IChoiceGroupOption[] = [
storiesOf('ChoiceGroup', module)
.addDecorator(TestWrapperDecorator)
.addDecorator(story => (
<Screener
steps={new Screener.Steps()
<StoryWright
steps={new Steps()
.snapshot('default', { cropTo: '.testWrapper' })
.hover('div.ms-ChoiceField:nth-of-type(1)')
.snapshot('hover unselected', { cropTo: '.testWrapper' })
Expand All @@ -27,7 +27,7 @@ storiesOf('ChoiceGroup', module)
.end()}
>
{story()}
</Screener>
</StoryWright>
))
.addStory('Root', () =>
// prettier-ignore
Expand Down
Loading