Skip to content

Commit

Permalink
✨ add fetching env support for storybook v7+ (#827)
Browse files Browse the repository at this point in the history
* feat: add fetching env support for storybook v7+

* chore: lint using --fix
  • Loading branch information
nilshah98 authored Oct 18, 2023
1 parent d24e398 commit 5a5762c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ export async function* withPage(percy, url, callback, retry) {
export function evalStorybookEnvironmentInfo({ waitForXPath }) {
return waitForXPath("//header[starts-with(text(), 'Storybook ')]", 5000)
.then(el => `storybook/${el.innerText.match(/-?\d*\.?\d+/g).join('')}`)
.catch(() => 'storybook/unknown');
.catch(() => {
waitForXPath("//strong[starts-with(text(), 'You are on Storybook ')]", 5000)
.then(el => `storybook/${el.innerText.match(/-?\d*\.?\d+/g).join('')}`)
.catch(() => 'storybook/unknown');
});
}

// Evaluate and return serialized Storybook stories to snapshot
Expand Down

0 comments on commit 5a5762c

Please sign in to comment.