-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Update dependencies to latest versions
- Loading branch information
Showing
4 changed files
with
80 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,5 @@ | ||
/// <reference types="cypress" /> | ||
import type { Clerk } from '@clerk/types'; | ||
// *********************************************** | ||
// This example commands.ts shows you how to | ||
// create various custom commands and overwrite | ||
// existing commands. | ||
// | ||
// For more comprehensive examples of custom | ||
// commands please read more here: | ||
// https://on.cypress.io/custom-commands | ||
// *********************************************** | ||
// | ||
// | ||
// -- This is a parent command -- | ||
// Cypress.Commands.add('login', (email, password) => { ... }) | ||
// | ||
// | ||
// -- This is a child command -- | ||
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This is a dual command -- | ||
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This will overwrite an existing command -- | ||
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) | ||
// | ||
declare global { | ||
namespace Cypress { | ||
interface Chainable { | ||
signOut(): Chainable<void> | ||
signIn(): Chainable<void> | ||
} | ||
} | ||
interface Window { | ||
Clerk: Clerk; | ||
} | ||
} | ||
import { addClerkCommands } from '@clerk/testing/cypress'; | ||
addClerkCommands({ Cypress, cy }); | ||
|
||
Cypress.Commands.add(`signOut`, () => { | ||
cy.log(`Sign out by clearing all cookies.`); | ||
cy.clearCookies({ domain: null, }); | ||
}); | ||
|
||
Cypress.Commands.add(`signIn`, () => { | ||
cy.log(`Signing in.`); | ||
|
||
cy.window() | ||
.should((window) => { | ||
expect(window).to.not.have.property(`Clerk`, undefined); | ||
expect(window.Clerk.loaded).to.eq(true); | ||
}) | ||
.then(async (window) => { | ||
const res = await window.Clerk.client.signIn.create({ | ||
identifier: Cypress.env(`test_user`), | ||
password: Cypress.env(`test_password`), | ||
}); | ||
|
||
await window.Clerk.setActive({ | ||
session: res.createdSessionId, | ||
}); | ||
|
||
cy.log(`Finished Signing in.`); | ||
}); | ||
}); | ||
|
||
// Prevent TypeScript from reading file as legacy script | ||
export {}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters