Skip to content

Commit

Permalink
Revised cypress test
Browse files Browse the repository at this point in the history
  • Loading branch information
evanping committed Jun 11, 2024
1 parent 3b67fb2 commit 6e7e70c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
16 changes: 13 additions & 3 deletions cypress/e2e/test.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ describe('test spec', () => {
it('passes', () => {
// initial yaml code for treatment
let yamltreatment = "name: cypress3_load_test\nplayerCount: 8\ngameStages:\n[]"

cy.viewport(2000, 1000, { log: false });

cy.visit('http://localhost:3000/editor')
cy.get('[data-cy="code-editor"]').type(yamltreatment)
cy.get('[data-cy="yaml-save"]').click()
Expand Down Expand Up @@ -79,6 +82,13 @@ describe('test spec', () => {
cy.get('[data-cy="element-1-1"]').contains("Prompt").should("be.visible")
cy.get('[data-cy="element-1-1"]').contains("Element 4").should("be.visible")

// add third stage via code editor
cy.get('[data-cy="code-editor"]').type("\n{backspace}{backspace}{backspace}{backspace}{backspace}{backspace}- name: Stage 3\n duration: 300\nelements: []")
cy.get('[data-cy="yaml-save"]').click()

cy.get('[data-cy="code-editor"]').contains("- name: Stage 3").should("be.visible")
cy.get('[data-cy="stage-2"]').contains("Stage 3").should("be.visible")

// edit first stage
cy.get('[data-cy="edit-stage-button-0"]').click()
cy.get('[data-cy="add-popup-name-editStage-0-"]').type(" Edited")
Expand All @@ -88,9 +98,9 @@ describe('test spec', () => {
cy.get('[data-cy="stage-0"]').contains("Stage 1 Edited").should("be.visible")

// delete second stage
cy.get('[data-cy="edit-stage-button-1"]').click()
cy.get('[data-cy="add-popup-delete-editStage-1-"]').click()
cy.get('[data-cy="edit-stage-button-2"]').click()
cy.get('[data-cy="add-popup-delete-editStage-2-"]').click()

cy.get('[data-cy="timeline"]').should("not.contain", "Stage 2")
cy.get('[data-cy="timeline"]').should("not.contain", "Stage 3")
})
})
10 changes: 9 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,12 @@ const nextConfig = {
reactStrictMode: true,
};

module.exports = nextConfig;
module.exports = {
...nextConfig,
/*
env: {
GITHUB_CLIENT_ID: process.env.GITHUB_CLIENT_ID,
GITHUB_CLIENT_SECRET: process.env.GITHUB_CLIENT_SECRET,
},
*/
};

0 comments on commit 6e7e70c

Please sign in to comment.