Skip to content

Commit

Permalink
cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
binrysearch committed Jul 6, 2024
1 parent 409b1ab commit 7b76616
Show file tree
Hide file tree
Showing 39 changed files with 41 additions and 34 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ dist/
.changelog

# Tests
tests/cypress/setup/dist
tests/cypress/videos/
tests/cypress/snapshots/actual
tests/cypress/snapshots/diff
cypress/setup/dist
cypress/videos/
cypress/snapshots/actual
cypress/snapshots/diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions cypress/support/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ declare namespace Cypress {
}
interface Window {
introJs: any;
click: () => void;
clickRelative: () => void;
clickAbsolute: () => void;
}
}
Binary file removed cypress/videos/hint/hideHints.cy.js.mp4
Binary file not shown.
Binary file removed cypress/videos/hint/modal.cy.js.mp4
Binary file not shown.
Binary file removed cypress/videos/hint/removeHints.cy.js.mp4
Binary file not shown.
Binary file removed cypress/videos/hint/showHints.cy.js.mp4
Binary file not shown.
Binary file removed cypress/videos/tour/dont-show-again.cy.js.mp4
Binary file not shown.
Binary file removed cypress/videos/tour/exit.cy.js.mp4
Binary file not shown.
5 changes: 3 additions & 2 deletions src/packages/tour/dont-show-again.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ context("Don't show again checkbox", () => {
it("should render the 'Dont show Again' checkbox", () => {
cy.window().then((window) => {
window
.introJs()
.introJs
.tour()
.setOptions({
dontShowAgain: true,
steps: [
Expand Down Expand Up @@ -36,7 +37,7 @@ context("Don't show again checkbox", () => {

it("should not display the tour if checkbox is clicked", () => {
cy.window().then((window) => {
const instance = window.introJs().setOptions({
const instance = window.introJs.tour().setOptions({
dontShowAgain: true,
steps: [
{
Expand Down
8 changes: 4 additions & 4 deletions src/packages/tour/exit.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ context("Exit", () => {

it("should remove leftovers from the DOM", () => {
cy.window().then((window) => {
const instance = window.introJs().setOptions({
const instance = window.introJs.tour().setOptions({
steps: [
{
intro: "step one",
Expand All @@ -32,7 +32,7 @@ context("Exit", () => {

it("should exit the tour after clicking on the skip icon", () => {
cy.window().then((window) => {
const instance = window.introJs().setOptions({
const instance = window.introJs.tour().setOptions({
steps: [
{
intro: "step one",
Expand All @@ -57,7 +57,7 @@ context("Exit", () => {

it("should exit the tour after clicking on the overlay layer", () => {
cy.window().then((window) => {
const instance = window.introJs().setOptions({
const instance = window.introJs.tour().setOptions({
steps: [
{
intro: "step one",
Expand All @@ -82,7 +82,7 @@ context("Exit", () => {

it("should not exit the tour after clicking on the tooltip layer", () => {
cy.window().then((window) => {
const instance = window.introJs().setOptions({
const instance = window.introJs.tour().setOptions({
steps: [
{
intro: "step one",
Expand Down
40 changes: 20 additions & 20 deletions src/packages/tour/highlight.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ context("Highlight", () => {

it("should highlight the target element", () => {
cy.window().then((window) => {
window
.introJs()
window.introJs
.tour()
.setOptions({
steps: [
{
Expand Down Expand Up @@ -34,8 +34,8 @@ context("Highlight", () => {

it("should let user interact with the target element", () => {
cy.window().then((window) => {
window
.introJs()
window.introJs
.tour()
.setOptions({
steps: [
{
Expand Down Expand Up @@ -65,8 +65,8 @@ context("Highlight", () => {

it("interaction with the target element should be disabled when disabledInteraction is true", () => {
cy.window().then((window) => {
window
.introJs()
window.introJs
.tour()
.setOptions({
disableInteraction: true,
steps: [
Expand All @@ -91,8 +91,8 @@ context("Highlight", () => {

it("should interaction with the target element the parent element has positive: relative", () => {
cy.window().then((window) => {
window
.introJs()
window.introJs
.tour()
.setOptions({
steps: [
{
Expand Down Expand Up @@ -123,8 +123,8 @@ context("Highlight", () => {
"z-index: 1;position: relative;"
);

window
.introJs()
window.introJs
.tour()
.setOptions({
steps: [
{
Expand All @@ -148,8 +148,8 @@ context("Highlight", () => {

it("should interaction with the target element the parent element has positive: absolute", () => {
cy.window().then((window) => {
window
.introJs()
window.introJs
.tour()
.setOptions({
steps: [
{
Expand Down Expand Up @@ -180,8 +180,8 @@ context("Highlight", () => {
"z-index: 1;position: absolute;"
);

window
.introJs()
window.introJs
.tour()
.setOptions({
steps: [
{
Expand All @@ -207,8 +207,8 @@ context("Highlight", () => {
cy.viewport(550, 750);

cy.window().then((window) => {
window
.introJs()
window.introJs
.tour()
.setOptions({
steps: [
{
Expand Down Expand Up @@ -236,8 +236,8 @@ context("Highlight", () => {
top: 200,
});

window
.introJs()
window.introJs
.tour()
.setOptions({
steps: [
{
Expand Down Expand Up @@ -265,8 +265,8 @@ context("Highlight", () => {
top: 200,
});

window
.introJs()
window.introJs
.tour()
.setOptions({
steps: [
{
Expand Down
8 changes: 5 additions & 3 deletions src/packages/tour/modal.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ context("Modal", () => {
it("should match the popup", () => {
cy.window().then((win) => {
win
.introJs()
.introJs
.tour()
.setOptions({
steps: [
{
Expand Down Expand Up @@ -40,7 +41,8 @@ context("Modal", () => {
cy.viewport("macbook-13");

win
.introJs()
.introJs
.tour()
.setOptions({
steps: [
{
Expand Down Expand Up @@ -77,7 +79,7 @@ context("Modal", () => {

it("should update the modal after refresh(true)", () => {
cy.window().then((win) => {
const instance = win.introJs().setOptions({
const instance = win.introJs.tour().setOptions({
showProgress: true,
showBullets: true,
steps: [
Expand Down
3 changes: 2 additions & 1 deletion src/packages/tour/navigation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ context("Navigation", () => {
beforeEach(() => {
cy.visit("./cypress/setup/index.html").then((window) => {
window
.introJs()
.introJs
.tour()
.setOptions({
steps: [
{
Expand Down

0 comments on commit 7b76616

Please sign in to comment.