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

Server/browser state for status API from JUnit report [yann, gert] #28688

Open
Tracked by #28388
yannbf opened this issue Jul 23, 2024 · 1 comment
Open
Tracked by #28388

Server/browser state for status API from JUnit report [yann, gert] #28688

yannbf opened this issue Jul 23, 2024 · 1 comment

Comments

@yannbf
Copy link
Member

yannbf commented Jul 23, 2024

No description provided.

Copy link
Contributor

greptile-apps bot commented Jul 23, 2024

** Disclaimer** This information might be inaccurate, due to it being generated automatically
To implement server/browser state for status API from JUnit report:

  1. Define Server Parameters: Update the story JSON files to include the necessary server parameters for the status API.

    {
      "title": "Example/Status",
      "parameters": {
        "server": {
          "url": "https://your-server-url/api",
          "id": "status",
          "params": { "report": "junit" }
        }
      },
      "stories": [
        {
          "name": "StatusReport",
          "args": { "status": "pass" }
        }
      ]
    }
  2. Fetch Status Data: Implement the fetchStoryHtml function to fetch data from the status API.

    // .storybook/preview.js
    const fetchStoryHtml = async (url, id, params, context) => {
      const response = await fetch(`${url}/${id}?report=${params.report}`);
      const html = await response.text();
      return html;
    };
    
    export const parameters = {
      server: {
        url: 'https://your-server-url/api',
        fetchStoryHtml,
      },
    };
  3. Update Stories: Ensure stories are defined to reflect the status API data.

    {
      "title": "Example/Status",
      "stories": [
        {
          "name": "StatusReport",
          "args": { "status": "pass" }
        }
      ]
    }

References

/.github/DISCUSSION_TEMPLATE/help.yml
/.github/DISCUSSION_TEMPLATE/ideas.yml
/.github/comments/invalid-link.md
/.github/DISCUSSION_TEMPLATE/rfc.yml
/.github/comments
/code/renderers/server/template/cli/header.stories.json
/code/renderers/server/template/cli/button.stories.json
/docs/_snippets/test-runner-with-index-json.md
/docs/_snippets/custom-build-script-production.md
/code/presets/server-webpack/src/lib/compiler/testfixtures/kitchen_sink.snapshot
/.github/DISCUSSION_TEMPLATE
/code/lib/cli/src/automigrate/fixes/new-frameworks.ts
/test-storybooks/ember-cli/ember-output/storybook-docgen
/code/frameworks/server-webpack5/README.md
/code/core/src/core-server/utils/mockdata/errors/NoMeta.stories.ts
/docs/get-started/why-storybook.mdx
/.github/PULL_REQUEST_TEMPLATE.md
/code/core/src/server-errors.ts
/code/renderers/server/template/cli
/docs/_snippets/test-runner-no-index-json.md
/CONTRIBUTING.md
/code/core/src/preview-errors.ts
/test-storybooks/portable-stories-kitchen-sink/svelte/cypress/fixtures
/docs/_snippets/checkbox-story-grouped.md
/code/core/src/preview-api/modules/preview-web/PreviewWeb.integration.test.ts

About Greptile

This response provides a starting point for your research, not a precise solution.

Help us improve! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

Ask Greptile · Edit Issue Bot Settings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant