{"id":28763413,"url":"https://github.com/verbb/snipcart-dev","last_synced_at":"2025-07-26T03:04:21.567Z","repository":{"id":37532899,"uuid":"170632820","full_name":"verbb/snipcart-dev","owner":"verbb","description":"Test site for the Snipcart Craft CMS plugin.","archived":false,"fork":false,"pushed_at":"2023-10-23T06:14:20.000Z","size":2369,"stargazers_count":4,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-25T03:08:21.723Z","etag":null,"topics":["craft3","craftcms","snipcart"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/verbb.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-02-14T05:29:33.000Z","updated_at":"2024-01-01T04:12:29.000Z","dependencies_parsed_at":"2023-01-17T14:46:27.716Z","dependency_job_id":"cbc93230-e941-4148-9dd3-e943f4244a6a","html_url":"https://github.com/verbb/snipcart-dev","commit_stats":null,"previous_names":["verbb/snipcart-dev"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/verbb/snipcart-dev","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verbb%2Fsnipcart-dev","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verbb%2Fsnipcart-dev/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verbb%2Fsnipcart-dev/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verbb%2Fsnipcart-dev/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/verbb","download_url":"https://codeload.github.com/verbb/snipcart-dev/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verbb%2Fsnipcart-dev/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267109939,"owners_count":24037627,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["craft3","craftcms","snipcart"],"created_at":"2025-06-17T09:09:12.444Z","updated_at":"2025-07-26T03:04:21.516Z","avatar_url":"https://github.com/verbb.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Snipcart Plugin Test Project\n\nA barebones test project for kicking the tires of [the Snipcart Craft CMS plugin](https://github.com/workingconcept/snipcart-craft-plugin) and making sure it behaves itself. BYO [Snipcart](https://snipcart.com/) and [ShipStation](https://www.shipstation.com/) API keys.\n\n![Example/testing site.](resources/site-screenshot.png)\n\n![Webhook API tests.](resources/api-test.png)\n\n## Features\n\n- [DDEV](https://github.com/drud/ddev) config for easy, Dockerized environment spin-up.\n- All email is captured with Mailhog; nothing will be sent out.\n- Shell script for initializing Craft install.\n- Content migration for adding Section, Fields and demo content.\n- [Codeception](https://codeception.com/) API and acceptance tests.\n- Shell script to sync local plugin changes into dev container.\n- Barebones configuration and front-end.\n\n## Goals\n\n- Facilitate local *and* automated testing. (No manual control panel actions required.)\n- Fully test the plugin in the context of a real Craft install.\n- Keep it possible to change stack quickly to reproduce issues.\n\n---\n\n## Initial Setup\n\nYou can get this running in whatever environment you're used to. It's preconfigured for DDEV for fast spin-up.\n\n[Install DDEV](https://ddev.readthedocs.io/en/stable/#installation), start the site with `ddev start`, and run the setup script from inside the container:\n\n```shell\nddev ssh\n./scripts/setup.sh\n```\n\n```shell\nphp craft migrate\n```\n\nThis will pull composer dependencies, install Craft, and install the Snipcart plugin. The site will be available at https://snipcart-test.ddev.site, and Mailhog will be running at http://snipcart-test.ddev.site:8025.\n\nLog into the control panel at https://snipcart-test.ddev.site/admin with username and password `supersecret`.\n\nRun the content migration separately to populate a Products section with fields and fake Entries.\n\n## Testing Setup\n\nThere are currently two kinds of tests:\n\n1. API tests that send data to the webhook endpoint to evaluate what comes back.\n2. Acceptance tests that actually open a browser and do stuff on pages.\n\nIf you want to run the acceptance tests, and *only* if you want to run the acceptance tests, you'll need to either install Selenium and a Chrome driver or configure tests/acceptance.suite.yml to use your own setup.\n\n**1. Install Selenium server and Chrome driver for browser testing.**\n\nSelenium:\n\n```shell\nbrew cask install java\nbrew cask info java\n\nbrew update\nbrew install selenium-server-standalone\n```\n\nChromeDriver:\n\n```shell\nbrew tap homebrew/cask\nbrew cask install chromedriver\n```\n\n**2. Run an instance of Selenium server before attempting browser tests.**\n\n```shell\nselenium-server\n```\n\n## Testing\n\nWebhook/API tests require specific configuration to fully pass. These gotchas are documented with `WARNING` notes in [tests/api/WebhookCest.php](tests/api/WebhookCest.php). Requirements include...\n\n- Setting valid Snipcart and ShipStation API keys.\n- Completing all required ShipStation and Ship From fields.\n- Enabling admin order email notifications with one email address.\n\nRun tests **from inside DDEV container** (`ddev ssh`, then run):\n\n```shell\ncomposer test-api\n```\n\nIf there's a 500 response or something mysterious that could use more detail, run with the `--debug` flag.\n\nRun browser tests **from outside DDEV container**:\n\n```shell\ncomposer test-browser\n```\n\nWork with testing container locally:\n\n```\ndocker run -d --name lemptest -p 8888:80 tonisormisson/dev-lemp\ndocker ps\ndocker exec -it [container-id] bash\n```\n\nInspect emails from testing at http://snipcart-test.ddev.site:8025.\n\n## Local Plugin + DDEV\n\nThis project is set up for testing and making live, local edits to the plugin source. You can edit composer.json like you normally would to have composer download a specific version of the plugin to /vendor, or you can use the existing setup to sync another local directory on your machine as detailed below.\n\n**1. Make sure to require plugin at `@dev` version in composer.json.**\n\n```json\n\"workingconcept/craft-snipcart\": \"@dev\",\n```\n\n**2. Sync local plugin changes into the project, which is specifically important because DDEV's Docker container isn't going to love symlinks.**\n\n`fswatch` is required:\n\n```shell\nbrew install fswatch\n```\n\nRun sync, which watches and rsyncs changes into the project folder:\n\n```shell\n./.script/rsync-snipcart-dev.sh\n```\n\n**3. Point composer.json to a local repository we'll sync into the project dir.**\n\n```json\n  \"repositories\": [\n    {\n      \"type\": \"path\",\n      \"symlink\": false,\n      \"url\": \"./plugins/snipcart/\"\n    },\n  ]\n```\n\n```\ncomposer update\n```\n\n## Share Local Server with ngrok\n\n1. install ngrok with homebrew (`brew cask install ngrok`)\n2. create ngrok account at ngrok.io\n3. issue the offered `ngrok authtoken` command\n4. `ngrok http 32770` (where 32770 is the project's web container port `docker ps | grep -- ddev-snipcart-test-web`)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fverbb%2Fsnipcart-dev","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fverbb%2Fsnipcart-dev","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fverbb%2Fsnipcart-dev/lists"}