{"id":22268081,"url":"https://github.com/curityio/curity-cypress-commands","last_synced_at":"2025-09-13T13:39:16.028Z","repository":{"id":57699689,"uuid":"500352056","full_name":"curityio/curity-cypress-commands","owner":"curityio","description":"Cypress commands used when testing the Curity Identity Server plugins","archived":false,"fork":false,"pushed_at":"2022-06-07T11:24:05.000Z","size":71,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-06-27T10:05:33.486Z","etag":null,"topics":["cypress","testing"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/curityio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-06T08:30:48.000Z","updated_at":"2023-04-27T09:50:00.000Z","dependencies_parsed_at":"2022-09-26T21:10:34.368Z","dependency_job_id":null,"html_url":"https://github.com/curityio/curity-cypress-commands","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/curityio/curity-cypress-commands","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curityio%2Fcurity-cypress-commands","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curityio%2Fcurity-cypress-commands/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curityio%2Fcurity-cypress-commands/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curityio%2Fcurity-cypress-commands/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/curityio","download_url":"https://codeload.github.com/curityio/curity-cypress-commands/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curityio%2Fcurity-cypress-commands/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262235780,"owners_count":23279566,"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":["cypress","testing"],"created_at":"2024-12-03T11:11:01.622Z","updated_at":"2025-06-27T10:06:56.567Z","avatar_url":"https://github.com/curityio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Curity Cypress Commands\n\nCypress commands used when testing the Curity Identity Server plugins.\n\n## Installation\n\nInstall using npm, with\n\n```shell\nnpm install -D @curity/cypress-commands\n```\n\n## Usage\n\nTo use the commands in your tests:\n\n1. Import the registration function in your spec file with `import { registerCurityCommands } from '@curity/cypress-commands`.\n2. Register commands once before running any tests by calling `registerCurityCommands()`.\n3. You can then use the commands as any other Cypress command, e.g. `cy.getIDToken()`.\n\nYou can see the spec files in `cypress/integration` to check how the commands are used in Cypress tests. \n\n### Registering with a Prefix\n\nIf you happen to use other custom Cypress commands with the same names, then you can register the Curity commands with a prefix.\nE.g. `registerCurityCommands('curity')`. All command names from this package will be prefixed with the chosen string and the\nfirst letter of the original command name will be capitalized. E.g. `getIDToken` will become `curityGetIDToken`.\n\nNote that you will not get Typescript support if you register commands with a prefix.\n\n## Available commands\n\n- [buildAuthorizationURL](#buildauthorizationurl)\n- [startAuthorization](#startauthorization)\n- [decodeJWT](#decodejwt)\n- [getIDToken](#getidtoken)\n- [getIDTokenClaims](#getidtokenclaims)\n\n### buildAuthorizationURL\n\nPrepares an authorization URL object based on the passed parameters. See `src/index.d.ts` for the list of currently supported parameters.\n\nExample usage\n\n```javascript\n    cy.buildAuthorizationURL({baseURL: \"https://idsvr.example.com\", clientID: \"client1\"})\n        .then(url =\u003e cy.visit(url.toString())).get('#login').should('exist')\n```\n\n### startAuthorization\n\nVisits the Authorization URL. Either the previous subject needs to be a URL or the parameters object must be passed.\nSee `src/index.d.ts` for the list of currently supported parameters.\n\nExample usage\n\n```javascript\n    const parameters = { baseURL: \"https://idsvr.example.com\", clientID: \"client1\" }\n    cy.buildAuthorizationURL(parameters).startAuthorization().get('#login').should('exist')\n    cy.startAuthorization(parameters).get('#login').should('exist')\n```\n\n### decodeJWT         \n\nDecodes a JWT and returns its claims in form of a map. If no parameter is passed then the previous subject is taken as the token.\n\nExample usage\n\n```javascript\n    cy.decodeJWT(token).its('sub').should('equal', 'john.doe')\n```\n\n### getIDToken\n\nGets the ID token from the fragment part of the current URL.\n\nExample usage\n\n```javascript\n    cy.getIDToken().should('not.be.empty')\n```\n\n### getIDTokenClaims\n\nGets the ID token from the fragment part of the current URL, decodes it and returns its claims. It's a shorthand for calling\n`getIDToken` and `decodeJWT` in a chain.\n\nExample usage\n\n```javascript\n    cy.getIDTokenClaims().its('sub').should('equal', 'john.doe')\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurityio%2Fcurity-cypress-commands","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcurityio%2Fcurity-cypress-commands","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurityio%2Fcurity-cypress-commands/lists"}