Skip to content

Commit

Permalink
Testing for each Individual pages
Browse files Browse the repository at this point in the history
  • Loading branch information
YuxinZhang214 committed Dec 17, 2023
1 parent b892e7b commit 14e49a0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 38 deletions.
35 changes: 0 additions & 35 deletions cypress/e2e/home_page.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,6 @@ describe('The home page when opening the demo', () => {
cy.visit('/');
// Steps for testing project import
});

it('stays at dashboard page when click on the tasks link', () => {
cy.get('#nav-tasks').should('be.visible').click()
cy.url().should('eq', '/')
})

it('stays at dashboard page when click on the users link', () => {
cy.get('#nav-users').should('be.visible').click()
cy.url().should('eq', '/')
})

it('stays at dashboard page when click on the categories link', () => {
cy.get('#nav-categories').should('be.visible').click()
cy.url().should('eq', '/')
})
})

context('when project data exists', () => {
Expand Down Expand Up @@ -79,25 +64,5 @@ describe('The home page when opening the demo', () => {
cy.get('#deleteProjectButton').should('exist')

})

it('navigates to the Tasks page', () => {
cy.get('#nav-tasks').debug().click();
cy.url().should('include', '/tasks')
})

it('navigates to the Users page', () => {
cy.get('#nav-users').should('be.visible').click()
cy.url().should('include', '/users')
})

it('navigates to the Categories page', () => {
cy.get('#nav-categories').should('be.visible').click()
cy.url().should('include', '/categories')
})

it('return to the dashboard', () => {
cy.get('#nav-project').should('be.visible').click()
cy.url().should('eq', '/')
})
})
})
10 changes: 7 additions & 3 deletions cypress/e2e/tasks_page.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ describe('The solution page when click on Show Solution Detail link', () => {
cy.get('#nav-tasks').should('be.visible').click()
cy.url().should('eq', Cypress.config().baseUrl + '/tasks')
})

it('starts creating new tasks by clicking on the New Task button', () => {
cy.get('#nav-tasks').should('be.visible').click()
cy.url().should('eq', Cypress.config().baseUrl + '/tasks')
})

// it('navigates to [Another Page Name] and checks UI elements', () => {
// })


})
})

0 comments on commit 14e49a0

Please sign in to comment.