Skip to content

Commit

Permalink
feat(sdk): Add storybook docs for embedding SDK e2e tests debug (meta…
Browse files Browse the repository at this point in the history
  • Loading branch information
deniskaber authored Aug 6, 2024
1 parent 5ed7d78 commit 22944e1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
8 changes: 8 additions & 0 deletions docs/developers-guide/e2e-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,14 @@ Cypress._.times(N, ()=> {
});
```

### Embedding SDK tests

Tests located in `e2e/test/scenarios/embedding-sdk` are used to run automated checks for the Embedding SDK.

Embedding SDK is a library, and not an application. We use Storybook to host public components, and we run tests against it.

In order to run stories used for tests locally, please check [storybook setup docs](https://github.com/metabase/metabase/blob/master/enterprise/frontend/src/embedding-sdk/README.md#storybook)

## DB Snapshots

At the beginning of each test suite we wipe the backend's db and settings cache. This ensures that the test suite starts in a predictable state.
Expand Down
18 changes: 17 additions & 1 deletion enterprise/frontend/src/embedding-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ java -jar metabase.jar
You can then use the API key to authenticate with Metabase in your application. Here's an example of how you can
authenticate with the API key:

```
```
const metabaseConfig = {
...
apiKey: "YOUR_API_KEY"
Expand Down Expand Up @@ -1011,6 +1011,22 @@ disclosure [here](https://github.com/metabase/metabase/blob/master/SECURITY.md#r

# Development

## Storybook

You can use storybook to run SDK components during local development.

When you have Metabase instance running:
```bash
yarn storybook-embedding-sdk
```


### Initial configuration
1. Set JWT secret to be "`0000000000000000000000000000000000000000000000000000000000000000`" in Admin > Authentication > JWT > String used by the JWT signing key
1. Make sure "User Provisioning" setting is set to "`on`".
1. Set Authorized Origins to "`*`" in Admin > Embedding > Interactive embedding


## Building locally

First you need to build the Metabase Embedding SDK for React locally:
Expand Down

0 comments on commit 22944e1

Please sign in to comment.