{"id":32909160,"url":"https://github.com/oxctl/deployment-test-utils","last_synced_at":"2026-03-07T11:01:21.505Z","repository":{"id":319122265,"uuid":"1066279400","full_name":"oxctl/deployment-test-utils","owner":"oxctl","description":"Shared configuration and utility scripts to support deployment E2E tests with Playwright.","archived":false,"fork":false,"pushed_at":"2026-02-06T17:42:54.000Z","size":111,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-07T01:48:23.589Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/oxctl.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-29T09:17:15.000Z","updated_at":"2026-02-06T17:42:56.000Z","dependencies_parsed_at":"2025-10-21T10:16:13.290Z","dependency_job_id":null,"html_url":"https://github.com/oxctl/deployment-test-utils","commit_stats":null,"previous_names":["oxctl/deployment-test-utils"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/oxctl/deployment-test-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxctl%2Fdeployment-test-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxctl%2Fdeployment-test-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxctl%2Fdeployment-test-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxctl%2Fdeployment-test-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oxctl","download_url":"https://codeload.github.com/oxctl/deployment-test-utils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxctl%2Fdeployment-test-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30212103,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T09:02:10.694Z","status":"ssl_error","status_checked_at":"2026-03-07T09:02:08.429Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2025-11-10T16:30:57.193Z","updated_at":"2026-03-07T11:01:21.493Z","avatar_url":"https://github.com/oxctl.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @oxctl/deployment-test-utils\n\nShared configuration and utility scripts to support Canvas LTI tool deployment (E2E) tests with Playwright.\n\nThis package provides:\n\n * Playwright configuration (`config.js`)\n   - Includes `assertVariables` and `setup` projects that run before your deployment tests.\n * Setup scripts under `src/setup/`\n   - `assertVariables.js` – ensures required environment variables are set.\n   - `auth.setup.js` – authenticates and writes a temporary Playwright `storageState` for your tests.\n * Reusable test utilities (`testUtils.js`)\n   - Helpers for logging in, handling banners, waiting for spinners, etc.\n\n⸻\n\n## Installation\n\nIn your consumer project (the project in which you want to run deployment tests):\n\n```bash\nnpm i @oxctl/deployment-test-utils\n```\n## Configuration\nAdd the required dev dependencies to your project (use your preferred package manager and versions):\n\n```bash\nnpm i -D @oxctl/deployment-test-utils @playwright/test dotenv\n```\n\n\u003e [!NOTE] \n\u003e Playwright 1.58.0 introduced a [bug](https://github.com/microsoft/playwright/issues/39172) that causes duplicate test title errors. This version of the library constrains Playwright to \u003c1.58.0 to avoid this issue, but if you are using a later version of Playwright in your project, you may need to adjust the version in your `package.json` to avoid conflicts.\n\nOptionally install Playwright browser binaries (if you haven't already):\n\n```bash\nnpx playwright install\n```\n\nThis library does not pin a Node.js or Playwright version. Use versions appropriate for your project.\nAny recent Playwright Test 1.x release should work; align with what you already use.\n\n\n\n\n\n## Write The Tests \n\nThe following must be set (locally via .env, or in CI via your provider's secrets/variables):\n * `CANVAS_HOST` - trailing slash is optional\n * `OAUTH_TOKEN`\n * `TEST_PATH` - leading slash is optional (Previously named `URL` which was changed as it was found to be confusing.)\n\n\nIf any are missing, `assertVariables.js` will fail fast to help you diagnose configuration.\n\nExample:\n\n```bash\nCANVAS_HOST=https://wibble.instructure.com\nOAUTH_TOKEN=12345~QWERTYUIOPASDFGHJKLZXCVBNM\nTEST_PATH=/accounts/1/external_tools/789\n```\n\nUse the utilities from this repository when writing your deployment tests. Here's a simple example which asserts that some specific text, `XXXXXXXXXXXXXXX`, appears on a page. The test(s) can be as simple or as complex as seems appropriate.\n\n```js\nimport { test, expect } from '@playwright/test'\nimport { dismissBetaBanner, getLtiIFrame, waitForNoSpinners, TEST_URL } from '@oxctl/deployment-test-utils'\n\ntest.describe('Test deployment', () =\u003e {\n    test('The tool should load and the text \"XXXXXXXXXXXXXXX\" should be shown', async ({context, page}) =\u003e {\n    await page.goto(TEST_URL)\n    await dismissBetaBanner(page)\n    const ltiIFrame = getLtiIFrame(page)\n    await waitForNoSpinners(ltiIFrame)\n\n    // Check there's specific text on the page\n    const text = ltiIFrame.getByText(\"XXXXXXXXXXXXXXX\")\n    await expect(text).toBeVisible();\n  })\n})\n```\nRun tests using your normal Playwright command (for example):\n\n```bash\nnpm run test\n```\n## Auth storage state\n\nThe setup project (`auth.setup.js`) will:\n * Authenticate using your token/URL.\n * Write a `playwright/.auth/user.json` into the consumer repo workspace.\n * Your deployment tests (browser projects e.g. `chromium`) then reuse this state via `storageState` .\n\n⚠️ Note: In __GitHub Actions__ this file is only created in the ephemeral job workspace and is cleaned up automatically when the job ends. It is not committed to source control, and there is no risk of leaking long-lived credentials.\n\nIt is not tidied up on your local machine and should never be committed to source control so should be added to `.gitignore` (see above).\n\n⸻\n\n## Project structure\n\n```\nsrc/\n├── config.js          # exports Playwright projects\n├── testUtils.js       # reusable Playwright helpers\n└── setup/\n├── assertVariables.js\n└── auth.setup.js\n```\n\n## Development\n\nIn this repo:\n\n```bash\nnpm run build      # bundle testUtils.js to dist/\nnpm pack           # create a tarball for local install\n```\n\nIn the consumer repo:\n\n```bash\nnpm i ../path/to/oxctl-deployment-test-utils-1.0.0.tgz\n```\n\nThen run tests as normal:\n\n```bash\nnpx playwright test\n```\n\n\n## Releasing\n\nThis library is published to npmjs. To make a new release do either:\n\n```bash\nnpm version patch\n```\nfor a small change, or\n\n```bash\nnpm version minor\n```\nfor a large or 'breaking' change.\n\n\n\nAnd then if it completes ok push the tags and GitHub actions will build and publish the package to npmjs.\n\n```bash\ngit push\ngit push --tags\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foxctl%2Fdeployment-test-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foxctl%2Fdeployment-test-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foxctl%2Fdeployment-test-utils/lists"}