-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: add ability to specify autoscreenshotSelector in story-files #21
Conversation
@@ -7,6 +7,7 @@ export interface StorybookStoryExtended extends StorybookStory { | |||
assertViewOpts: AssertViewOpts; | |||
browserIds: Array<string | RegExp> | null; | |||
extraTests?: Record<string, TestplaneTestFunction>; | |||
autoscreenshotSelector: string | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это - внутренний тип стори, расширенный дополнительными полями
@@ -22,6 +22,7 @@ export type TestplaneMetaConfig<T = void> = Combined< | |||
skip?: boolean; | |||
assertViewOpts?: AssertViewOpts; | |||
browserIds?: Array<string | RegExp>; | |||
autoscreenshotSelector?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это - внешний тип, используемый пользователем.
@@ -44,6 +44,7 @@ export function extendStoriesFromStoryFile(stories: StorybookStory[]): Storybook | |||
story.skip = testplaneStoryOpts.skip || false; | |||
story.assertViewOpts = testplaneStoryOpts.assertViewOpts || {}; | |||
story.browserIds = testplaneStoryOpts.browserIds || null; | |||
story.autoscreenshotSelector = testplaneStoryOpts.autoscreenshotSelector || null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Прокидываем в сторю селектор, аналогично остальным опциям из default export
@@ -24,7 +24,7 @@ function createTestplaneTests(story: StorybookStoryExtended, { autoScreenshots } | |||
|
|||
const result = await openStoryStep(ctx.browser, story); | |||
|
|||
await autoScreenshotStep(ctx.browser, result.rootSelector); | |||
await autoScreenshotStep(ctx.browser, story.autoscreenshotSelector || result.rootSelector); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Если в сторе указан селектор (который прорастает туда из дефолтного экспорта), то он имеет приоритет над стандартным
No description provided.