{"id":20651814,"url":"https://github.com/saucelabs/sample-app-web","last_synced_at":"2025-04-07T13:05:39.037Z","repository":{"id":39238904,"uuid":"151465238","full_name":"saucelabs/sample-app-web","owner":"saucelabs","description":"This is the Sauce Labs Sample Application which is designed to be used from desktop web browsers","archived":false,"fork":false,"pushed_at":"2025-02-26T14:08:38.000Z","size":17127,"stargazers_count":28,"open_issues_count":11,"forks_count":46,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-31T12:04:09.120Z","etag":null,"topics":["common"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saucelabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-03T19:02:57.000Z","updated_at":"2025-03-10T08:37:31.000Z","dependencies_parsed_at":"2023-02-05T01:45:53.816Z","dependency_job_id":"9869db32-00bf-4ff7-8ee2-356d4d2cc8e1","html_url":"https://github.com/saucelabs/sample-app-web","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saucelabs%2Fsample-app-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saucelabs%2Fsample-app-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saucelabs%2Fsample-app-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saucelabs%2Fsample-app-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saucelabs","download_url":"https://codeload.github.com/saucelabs/sample-app-web/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247657275,"owners_count":20974344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["common"],"created_at":"2024-11-16T17:29:50.597Z","updated_at":"2025-04-07T13:05:39.016Z","avatar_url":"https://github.com/saucelabs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# What is this codebase?\nThis is the Sauce Labs Sample Application which is designed to be used from desktop web browsers\n\n![sample-app-web workflow](https://github.com/saucelabs/sample-app-web/actions/workflows/sample-app-web.yml/badge.svg)\n[![codecov](https://codecov.io/gh/saucelabs/sample-app-web/branch/master/graph/badge.svg?token=Q4UsgDSRd3)](https://codecov.io/gh/saucelabs/sample-app-web)\n\n- [Setup](#setup)\n  - [Requirements](#requirements)\n  - [Build](#build)\n  - [Storybook](#storybook)\n- [Test](#test)\n- [Deploy](#deploy)\n\n## Setup\n### Requirements\nTo set up the development environment directly on your host computer:\n\n1. You’ll need [Node.js](http://nodejs.org) installed (this needs to be NodeJS 14, not higher). If you don't have Node installed,\nwe recommend installing [NVM](https://github.com/creationix/nvm) to assist managing multiple active Node.js versions.\n1. Install [OpenJDK 8](https://adoptopenjdk.net/) for running the end-to-end tests\n1. Install [Google Chrome](https://www.google.com/chrome/) for running the end-to-end tests\n1. Clone the project somewhere on your computer\n\n        git clone git@github.com:\u003cyour-username\u003e/sample-app-web.git\n\n1. Install all dependencies by running this command from the **root of the project**\n\n        npm install\n\n### Error reporting with Backtrace\nTo set up error reporting with your Backtrace instance:\n\n1. Open `src/index.jsx` file and find the `BacktraceClient.initialize` function call:\n    ```tsx\n    BacktraceClient.initialize({\n        name: 'Swag Store',\n        version: '3.0.0',\n        url: 'https://submit.backtrace.io/UNIVERSE/TOKEN/json',\n        userAttributes: () =\u003e ({\n            user: currentUser(),\n            shoppingCart: ShoppingCart.getCartContents()\n        })\n    })\n    ```\n1. Replace `UNIVERSE` and `TOKEN` in `url` with your universe and token. \n\nFor more details, [see the docs about React integration with Backtrace](https://docs.saucelabs.com/error-reporting/language-integrations/react/).\n\n### Build\n1. Build the application with\n\n        npm run start\n\n    This will build the application, start Chrome and load the website on [http://localhost:3000/](http://localhost:3000/)\n\n1. Click around - this is the app!\n\n### Sourcemaps in error reporting with Backtrace\nTo enable additional insight in Backtrace, you can send built sourcemaps and sources to Backtrace:\n1. Open `.backtracejsrc` file\n1. Replace `UNIVERSE` and `TOKEN` in `upload.url` with your universe and token.\n1. Build the application with\n\n        npm run build\n\n1. Run `backtrace-js`\n\n        npm run backtrace.sourcemaps\n\n1. Host the app using e.g. `http-server` (sourcemaps integration won't work with `npm run start`)\n\n        npx http-server -p 3000 ./build\n        \n1. New uploaded errors should display with sourcemaps attached!\n\nFor more details, [see the docs about sourcemap integration with Backtrace](https://docs.saucelabs.com/error-reporting/platform-integrations/source-map/).\n\n### Storybook\nThis website uses components which can be tested with Storybook. To run Storybook execute the following command:\n\n    npm run storybook \n\nThis will open Storybook on [http://localhost:6006/](http://localhost:6006/). More information about Storybook can be \nfound [here](https://storybook.js.org/docs/react/get-started/introduction).\n\n## Test\n### E2E\n#### Testing locally\nTo run the application test suite (which uses Webdriver.io, Selenium, and Chrome) make sure the application is running\non [http://localhost:3000/](http://localhost:3000/) (see above steps)\n\n    npm run test.e2e.local\n\nThis will run the application test suite\n\n#### Testing on Sauce Labs\nRunning on Sauce Labs uses Environment Variables to authenticate credentials. You can find a guide on how to do this\n[here.](https://wiki.saucelabs.com/display/DOCS/Best+Practice%3A+Use+Environment+Variables+for+Authentication+Credentials)\n\n1. `npm run test.e2e.sauce.us` to run tests on the Sauce Labs in the US Data Center\n2. `npm run test.e2e.sauce.eu` to run tests in the EU Data Center\n\n\u003e Make sure you've added the `SCREENER_API_KEY` variable to your environment variables.\n\n### Visual Component Testing\nYou can test the components with Screener Component testing by running the following commands\n\n    # This will test all components on Chrome only\n    npm run test.storybook.ci\n    \n    # This will test all components on Chrome and Safari in mobile viewports\n    npm run test.storybook.mobile\n    \n    # This will test all componentes on Chrome, Safari, Firefox and Safari\n    # with different desktop resolutions\n    npm run test.storybook.desktop\n\nEach PR to master will also test the components with the `test.storybook.ci`-command.\n\n\u003e Make sure you've added the `SAUCE_USERNAME` and `SAUCE_ACCESS_KEY` variables to your environment variables.\n\n## Deploy\n\nMerges to master need to manually be triggered in [Actions \u003e github pages release](https://github.com/saucelabs/sample-app-web/actions/workflows/github-pages.yml) and will automatically deploy to:\n* https://www.saucedemo.com\n* https://saucelabs.github.io/sample-app-web/\n\nSee: [.github/workflows/github-pages.yml GitHub Action](.github/workflows/github-pages.yml)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaucelabs%2Fsample-app-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaucelabs%2Fsample-app-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaucelabs%2Fsample-app-web/lists"}