Comments (2)
it's not working even i have added this
test-runner-jest.js
const { getJestConfig } = require('@storybook/test-runner');
/**
- @type {import('@jest/types').Config.InitialOptions}
/
module.exports = {
// The default configuration comes from @storybook/test-runner
...getJestConfig(),
/* Add your own overrides below- @see https://jestjs.io/docs/configuration
*/
testTimeout: 30000,
};
- @see https://jestjs.io/docs/configuration
from test-runner.
@shajjhusein I had this same issue, it seems there's no built in way to configure the playwright timeouts (e.g. navigation timeout which you are hitting) when using the storybook test runner (possible feature request for this?).
For now I'm using the following workaround (basically replace defaultPrepare from storybook):
.storybook/test-runner.ts
import type { TestRunnerConfig } from '@storybook/test-runner';
const config: TestRunnerConfig = {
async prepare({ page, browserContext, testRunnerConfig }) {
page.setDefaultTimeout(120 * 1000); // set here to whatever you need
const targetURL = process.env.TARGET_URL;
const iframeURL = new URL('iframe.html', targetURL).toString();
if (testRunnerConfig.getHttpHeaders) {
const headers = await testRunnerConfig.getHttpHeaders(iframeURL);
await browserContext.setExtraHTTPHeaders(headers);
}
await page.goto(iframeURL, { waitUntil: 'load' }).catch((err) => {
if (err instanceof Error && err.message.includes('ERR_CONNECTION_REFUSED')) {
const errorMessage = `Could not access the Storybook instance at ${targetURL}. Are you sure it's running?\n\n${err.message}`;
throw new Error(errorMessage);
}
throw err;
});
},
};
export default config;
from test-runner.
Related Issues (20)
- [bug] coverage no longer report in terminal HOT 2
- [bug] Add support for passWithNoTests
- [question] Error: Cannot find module 'detect-package-manager' HOT 2
- [bug] test-runner doesn't execute in the project folder HOT 2
- CLI tests don't run using chromium browser with error message "invalid version" HOT 1
- [bug] --failOnConsole not working with Mock Service Worker
- [bug] Issue with open HTTP connections: Jest did not exit
- Skip or Exclude not working on play-tests HOT 2
- How to specify Chromium path HOT 3
- Installation Error with NPM HOT 2
- [question] Any plans to move or support vitest?
- [bug] Doesn't work with git worktrees HOT 1
- [Bug]: Type of canvasElement from getStoryContext is unknown HOT 2
- [question] Any plans to support v8.0.0???? HOT 1
- Test runner rendering next story before previous tests finish
- [bug] `getStoryContext` is missing `playFunction` HOT 1
- [bug] preVisit accesses the story store before the index is ready HOT 9
- [bug] the --outputFile parameter is not working when --junit parameter is issued HOT 4
- [feature request] Make tags available in the test context HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from test-runner.