Skip to content

Commit 00bf3d1

Browse files
authored
Merge pull request #16 from applitools/updating
Updating
2 parents bffee65 + 7119e15 commit 00bf3d1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+18628
-25481
lines changed

.github/workflows/test.yml

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,44 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
node-version: [12.x]
15+
node-version: [18.x]
1616

1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
1919

20-
- name: Use Node.js ${{ matrix.node-version }}
21-
uses: actions/setup-node@v1
20+
- name: Set up Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v4
2222
with:
2323
node-version: ${{ matrix.node-version }}
24+
25+
- name: Install required dependencies for Puppeteer
26+
run: |
27+
sudo apt-get update
28+
sudo apt-get install -y \
29+
libnss3 \
30+
libatk1.0-0 \
31+
libatk-bridge2.0-0 \
32+
libxcomposite1 \
33+
libxdamage1 \
34+
libxrandr2 \
35+
libgbm1 \
36+
libasound2 \
37+
libpangocairo-1.0-0 \
38+
libatspi2.0-0 \
39+
libcups2 \
40+
libxss1 \
41+
libxshmfence1 \
42+
libglu1-mesa \
43+
libpci3 \
44+
libdrm2 \
45+
libgtk-3-0 \
46+
chromium-browser || sudo apt-get install -y chromium
47+
48+
- name: Install dependencies
49+
run: npm ci
2450

25-
- run: npm ci
26-
27-
- run: npx eyes-storybook
51+
- name: Run Eyes Storybook
52+
run: npx eyes-storybook -f ./applitools.config.js
2853
env:
2954
APPLITOOLS_API_KEY: ${{ secrets.APPLITOOLS_API_KEY }}
55+

.github/workflows/updates.yml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,41 @@ name: Updates
22

33
on:
44
schedule:
5-
- cron: "0 12 * * *"
5+
- cron: "0 12 * * *" # Runs daily at 12:00 UTC
66
workflow_dispatch:
77

88
jobs:
99
test:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
1414

15-
- name: Use Node.js 12.x
16-
uses: actions/setup-node@v1
15+
- name: Set up Node.js 20.x
16+
uses: actions/setup-node@v4
1717
with:
18-
node-version: 12.x
18+
node-version: 20.x
1919

20-
- run: npm install
20+
- name: Install dependencies
21+
run: npm install
2122

22-
- run: npm install -g npm-check-updates
23+
- name: Install npm-check-updates
24+
run: npm install -g npm-check-updates
2325

2426
- name: Check for Updates
2527
run: ncu -u
2628

27-
- name: Install Updates
29+
- name: Install Updated Packages
2830
run: npm install
2931

30-
- run: npx eyes-storybook
32+
- name: Run Eyes Storybook
33+
run: npx eyes-storybook
3134
env:
3235
APPLITOOLS_API_KEY: ${{ secrets.APPLITOOLS_API_KEY }}
33-
34-
- uses: mikeal/publish-to-github-action@master
35-
env:
36-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37-
BRANCH_NAME: 'master'
36+
37+
- name: Publish Changes to GitHub
38+
uses: ad-m/[email protected]
39+
with:
40+
github_token: ${{ secrets.GITHUB_TOKEN }}
41+
branch: 'master'
42+

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
.env.development.local
1616
.env.test.local
1717
.env.production.local
18+
/storybook-static
1819

1920
npm-debug.log*
2021
yarn-debug.log*
2122
yarn-error.log*
23+
24+
*storybook.log

.storybook/config.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

.storybook/main.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
3+
/** @type { import('@storybook/react-webpack5').StorybookConfig } */
4+
const config = {
5+
"stories": [
6+
"../src/**/*.mdx",
7+
"../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"
8+
],
9+
10+
"addons": [
11+
"@storybook/addon-essentials",
12+
"@storybook/preset-create-react-app",
13+
"@storybook/addon-onboarding",
14+
"@storybook/addon-interactions"
15+
],
16+
17+
"framework": {
18+
"name": "@storybook/react-webpack5",
19+
"options": {}
20+
},
21+
22+
"staticDirs": [
23+
],
24+
25+
docs: {
26+
autodocs: false
27+
},
28+
29+
typescript: {
30+
reactDocgen: "react-docgen-typescript"
31+
}
32+
};
33+
export default config;

README.md

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,37 @@
11
# Applitools Tutorial - Storybook React
22

3-
Get started with Applitools Eyes visual testing with this example of using the [Storybook](https://storybook.js.org/) and the [Eyes Storybook SDK](https://github.com/applitools/eyes.sdk.javascript1/tree/master/packages/eyes-storybook).
3+
Get started with Applitools Eyes visual testing with this example of using [Storybook](https://storybook.js.org/) and our [Eyes Storybook SDK](https://applitools.com/tutorials/sdks/storybook).
44

5-
Learn more about how to install and start this project with our [Storybook React tutorial](https://applitools.com/tutorials/storybook-react.html)!
6-
7-
<https://applitools.com/tutorials/storybook-react.html>
5+
Learn more about how to install and start this project with our [Storybook React tutorial](https://applitools.com/tutorials/sdks/storybook)!
86

97
_If you're looking for the CSF format for creating Storybook stories, check out the [Storybook CSF React tutorial](https://github.com/applitools/tutorial-storybook-csf-react)._
108

9+
# Installation & Run
10+
1. Install the dependencies
11+
```sh
12+
npm install
13+
```
14+
15+
To authenticate via the Applitools server and run tests, you need to set your API key provided from Applitools Eyes. For details on how to retrieve your API key, see [the Applitools documentation](https://applitools.com/tutorials/getting-started/retrieve-api-key).
16+
17+
2. Choose one of the following options to set your API Key.
18+
* Set your Applitools API Key as an environment variable.
19+
* macOS/Linux: `export APPLITOOLS_API_KEY=<Your API Key>`
20+
* Windows: `set APPLITOOLS_API_KEY=<Your API Key>`
21+
22+
* Set your Applitools API Key inside the **applitools.config.js** file via the `apiKey` setting.
23+
* Note: If you are not using the Eyes public cloud, you will need to update the `serverUrl` to your Eyes server URL in the **applitools.config.js** configuration file or set via an `APPLITOOLS_SERVER_URL` environment variable. See our [documentation](https://applitools.com/tutorials/sdks/storybook/config) for more information on these settings.
24+
25+
3. Run the example test
26+
```sh
27+
npx eyes-storybook
28+
```
29+
30+
4. After the example tests complete. Visit your Applitools Eyes dashboard to view the results.
31+
1132
## More Information
1233

13-
Learn more about Applitools [Eyes](https://info.applitools.com/ucY77) and the [Ultrafast Test Cloud](https://info.applitools.com/ucY78) at [applitools.com](https://info.applitools.com/ucY76).
34+
Learn more about [Applitools Eyes](https://www.applitools.com) and the [Applitool Ultrafast Grid](https://applitools.com/platform/ultrafast-grid).
1435

15-
More about the Eyes Images SDK:
36+
More about the Eyes Storybook SDK:
1637
* https://www.npmjs.com/package/@applitools/eyes-storybook
17-
* https://applitools.com/docs/api/eyes-sdk/indexm/classindex-storybook-javascript.html

applitools.config.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
// See https://applitools.com/tutorials/sdks/storybook/config#properties for additional configuration properties.
12
module.exports = {
2-
concurrency: 1,
3+
apiKey: process.env.APPLITOOLS_API_KEY,
4+
serverUrl: 'https://eyes.applitools.com',
5+
batchName: 'Storybook React Tutorial',
6+
testConcurrency: 10,
7+
showLogs: false,
8+
browser: [ // See https://applitools.com/tutorials/sdks/storybook/browsers for additional supported browsers and devices.
9+
{ width: 1024, height: 768, name: 'chrome' },
10+
// { width: 1024, height: 768, name: 'firefox' },
11+
// { chromeEmulationInfo: { deviceName: 'Galaxy S20' } },
12+
],
13+
puppeteerOptions: process.env.GITHUB_ACTIONS
14+
? {
15+
executablePath: '/usr/bin/chromium',
16+
args: ['--no-sandbox', '--disable-setuid-sandbox']
17+
}
18+
: undefined,
319
}

0 commit comments

Comments
 (0)