diff --git a/cypress/integration/create-channel.spec.js b/cypress/integration/create-channel.spec.js index 54d2d8a..b28c0f1 100644 --- a/cypress/integration/create-channel.spec.js +++ b/cypress/integration/create-channel.spec.js @@ -14,7 +14,12 @@ context('Create Channel Browser Testing', () => { describe('Channel Creation process #1', () => { let channelName = 'Test Channel ', description = 'Test Description '; - it('should visit the channel creation screen', () => cy.naviagte('/admin/admin-circle-create')); + it('should visit the channel creation screen', () => { + cy.visit('/admin/admin-circle-create'); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/admin/admin-circle-create'); + }); + }); it('should enter correct channel data', () => { cy.randomNum().then(num => { channelName += num; @@ -43,7 +48,12 @@ context('Create Channel Browser Testing', () => { describe('Channel Creation process #2', () => { let channelName = 'Test Channel ', description = 'Test Description '; - it('should visit the channel creation screen', () => cy.naviagte('/admin/admin-circle-create')); + it('should visit the channel creation screen', () => { + cy.visit('/admin/admin-circle-create'); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/admin/admin-circle-create'); + }); + }); it('should enter correct channel data', () => { cy.randomNum().then(num => { channelName += num; @@ -72,7 +82,12 @@ context('Create Channel Browser Testing', () => { describe('Channel Creation process #3', () => { let channelName = 'Test Channel ', description = 'Test Description '; - it('should visit the channel creation screen', () => cy.naviagte('/admin/admin-circle-create')); + it('should visit the channel creation screen', () => { + cy.visit('/admin/admin-circle-create'); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/admin/admin-circle-create'); + }); + }); it('should enter correct channel data', () => { cy.randomNum().then(num => { channelName += num; diff --git a/cypress/integration/create-job-offer.spec.js b/cypress/integration/create-job-offer.spec.js index 0940eaa..ad960d4 100644 --- a/cypress/integration/create-job-offer.spec.js +++ b/cypress/integration/create-job-offer.spec.js @@ -22,7 +22,12 @@ context('Create Job Offer Browser Testing', () => { it('should visit user login screen', () => cy.userLogin()); it('should login', () => cy.login()); describe('Job Offer Creation process', () => { - it('should visit the job offer creation screen', () => cy.naviagte('/job-offers/job-offers-create')); + it('should visit the job offer creation screen', () => { + cy.visit('/job-offers/job-offers-create'); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/job-offers/job-offers-create'); + }); + }); it('should enter correct job offer data', () => { cy.get('#job-offers-create input[name="closingDate"]').clear().type(jobDate); cy.get('#job-offers-create input[name="closingDate"]').should('have.value', jobDate); diff --git a/cypress/integration/create-project.spec.js b/cypress/integration/create-project.spec.js index ba198c7..8775a1e 100644 --- a/cypress/integration/create-project.spec.js +++ b/cypress/integration/create-project.spec.js @@ -15,7 +15,12 @@ context('Create Project Browser Testing', () => { let projectName = 'Test Project ', customerName = 'Test Customer ', description = 'Test Description '; - it('should visit the project creation screen', () => cy.naviagte('/admin/admin-projects/admin-project-create')); + it('should visit the project creation screen', () => { + cy.visit('/admin/admin-projects/admin-project-create'); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/admin/admin-projects/admin-project-create'); + }); + }); it('should enter correct project data', () => { cy.randomNum().then(num => { projectName += num; @@ -48,7 +53,12 @@ context('Create Project Browser Testing', () => { let projectName = 'Test Project ', customerName = 'Test Customer ', description = 'Test Description '; - it('should visit the project creation screen', () => cy.naviagte('/admin/admin-projects/admin-project-create')); + it('should visit the project creation screen', () => { + cy.visit('/admin/admin-projects/admin-project-create'); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/admin/admin-projects/admin-project-create'); + }); + }); it('should enter correct project data', () => { cy.randomNum().then(num => { projectName += num; diff --git a/cypress/integration/create-user.spec.js b/cypress/integration/create-user.spec.js index f3fe42c..8cf9ee9 100644 --- a/cypress/integration/create-user.spec.js +++ b/cypress/integration/create-user.spec.js @@ -22,7 +22,12 @@ context('Create User Browser Testing', () => { it('should visit user login screen', () => cy.userLogin()); it('should login', () => cy.login()); describe('User Creation process', () => { - it('should visit the user creation screen', () => cy.naviagte('/admin/admin-users/admin-users-create')); + it('should visit the user creation screen', () => { + cy.visit('/admin/admin-users/admin-users-create'); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/admin/admin-users/admin-users-create'); + }); + }); it('should enter correct user data', () => { cy.get('#admin-users-create input[name="first_name"]').clear().type(firstName); cy.get('#admin-users-create input[name="first_name"]').should('have.value', firstName); diff --git a/cypress/integration/delete-channel.spec.js b/cypress/integration/delete-channel.spec.js index e022546..ac97861 100644 --- a/cypress/integration/delete-channel.spec.js +++ b/cypress/integration/delete-channel.spec.js @@ -23,12 +23,20 @@ context('Delete Channel Browser Testing', () => { it('should login', () => cy.login()); describe('Channel Retirement process', () => { let channelsLength; - it('should visit the channels list screen', () => cy.naviagte('/admin')); + it('should visit the channels list screen', () => { + cy.visit('/admin'); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/admin'); + }); + }); it('should visit the last channel edit screen', () => { cy.get(menuQuery.join(' ')) .invoke('attr', 'data-src') .then(url => cy.encodeUrl(url).then(id => { - cy.naviagte('/circle/@' + id + '/circle-information'); + cy.visit('/circle/@' + id + '/circle-information'); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/circle/@' + id + '/circle-information'); + }); })); }); it('should count the number of joined channels', () => { diff --git a/cypress/integration/edit-channel.spec.js b/cypress/integration/edit-channel.spec.js index f0baa3b..b1a8227 100644 --- a/cypress/integration/edit-channel.spec.js +++ b/cypress/integration/edit-channel.spec.js @@ -23,12 +23,20 @@ context('Edit Channel Browser Testing', () => { it('should visit user login screen', () => cy.userLogin()); it('should login', () => cy.login()); describe('Channel Edition process', () => { - it('should visit the channel list screen', () => cy.naviagte('/admin')); + it('should visit the channel list screen', () => { + cy.visit('/admin'); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/admin'); + }); + }); it('should visit the last channel edit screen', () => { cy.get(menuQuery.join(' ')) .invoke('attr', 'data-src') .then(url => cy.encodeUrl(url).then(id => { - cy.naviagte('/circle/@' + id + '/circle-information/circle-edit'); + cy.visit('/circle/@' + id + '/circle-information/circle-edit'); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/circle/@' + id + '/circle-information/circle-edit'); + }); })); }); it('should enter new channel data', () => { diff --git a/cypress/integration/edit-job-offer.spec.js b/cypress/integration/edit-job-offer.spec.js index 16c0f99..0ce7690 100644 --- a/cypress/integration/edit-job-offer.spec.js +++ b/cypress/integration/edit-job-offer.spec.js @@ -26,12 +26,20 @@ context('Edit Job Offer Browser Testing', () => { it('should visit user login screen', () => cy.userLogin()); it('should login', () => cy.login()); describe('Job Offer Edition process', () => { - it('should visit the job offers list screen', () => cy.naviagte('/job-offers')); + it('should visit the job offers list screen', () => { + cy.visit('/job-offers'); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/job-offers'); + }); + }); it('should visit the last job offer edit screen', () => { cy.get(menuQuery.join(' ')) .invoke('attr', 'data-src') .then(url => cy.encodeUrl(url).then(id => { - cy.naviagte('/job-offers/job-offers-edit/@' + id); + cy.visit('/job-offers/job-offers-edit/@' + id); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/job-offers/job-offers-edit/@' + id); + }); })); }); it('should enter new job offer data', () => { diff --git a/cypress/integration/edit-project.spec.js b/cypress/integration/edit-project.spec.js index 766c252..ba34765 100644 --- a/cypress/integration/edit-project.spec.js +++ b/cypress/integration/edit-project.spec.js @@ -25,12 +25,20 @@ context('Edit Project Browser Testing', () => { it('should visit user login screen', () => cy.userLogin()); it('should login', () => cy.login()); describe('Project Edition process', () => { - it('should visit the project list screen', () => cy.naviagte('/admin/admin-projects')); + it('should visit the project list screen', () => { + cy.visit('/admin/admin-projects'); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/admin/admin-projects'); + }); + }); it('should visit the last project edit screen', () => { cy.get(menuQuery.join(' ')) .invoke('attr', 'data-src') - .then(url => cy.encodeUrl(url).then(id => { - cy.naviagte('/project/@' + id + '/project-information/project-edit'); + .then(url => cy.encodeUrl(url).then(id => {{ + cy.visit('/project/@' + id + '/project-information/project-edit'); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/project/@' + id + '/project-information/project-edit'); + }); })); }); it('should enter new project data', () => { diff --git a/cypress/integration/edit-user.spec.js b/cypress/integration/edit-user.spec.js index ac29f41..5bc2923 100644 --- a/cypress/integration/edit-user.spec.js +++ b/cypress/integration/edit-user.spec.js @@ -26,7 +26,12 @@ context('Edit User Browser Testing', () => { it('should visit user login screen', () => cy.userLogin()); it('should login', () => cy.login()); describe('User Edition process', () => { - it('should visit the user edit screen', () => cy.naviagte('/profile/solid-profile-edit-profile')); + it('should visit the user edit screen', () => { + cy.visit('/profile/solid-profile-edit-profile'); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/profile/solid-profile-edit-profile'); + }); + }); /// Workaround - Routing bug - user won't land on edit profile screen it('should navigate to user edit screen', () => { cy.get('#solid-profile-my-profile solid-link[next="solid-profile-edit-profile"]').click(); diff --git a/cypress/integration/leave-channel.spec.js b/cypress/integration/leave-channel.spec.js index 638eb58..3b762c3 100644 --- a/cypress/integration/leave-channel.spec.js +++ b/cypress/integration/leave-channel.spec.js @@ -23,7 +23,12 @@ context('Leave Channel Browser Testing', () => { it('should visit user login screend', () => cy.userLogin()); it('should login', () => cy.login()); describe('Channel Leaving process', () => { - it('should visit the channels list screen', () => cy.naviagte('/admin')); + it('should visit the channels list screen', () => { + cy.visit('/admin'); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/admin'); + }); + }); it('should click the last channel leave button', () => { cy.get(tableListQuery.join(' ')).its('length').as('channelsLength'); cy.get(tableQuery.join(' ')).click(); diff --git a/cypress/integration/leave-project.spec.js b/cypress/integration/leave-project.spec.js index 8c623fe..886d3a2 100644 --- a/cypress/integration/leave-project.spec.js +++ b/cypress/integration/leave-project.spec.js @@ -23,7 +23,12 @@ context('Leave Project Browser Testing', () => { it('should visit user login screend', () => cy.userLogin()); it('should login', () => cy.login()); describe('Project Leaving process', () => { - it('should visit the projects list screen', () => cy.naviagte('/admin/admin-projects')); + it('should visit the projects list screen', () => { + cy.visit('/admin/admin-projects'); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/admin/admin-projects'); + }); + }); it('should click the last project leave button', () => { cy.get(tableListQuery.join(' ')).its('length').as('projectsLength'); cy.get(tableQuery.join(' ')).click(); diff --git a/cypress/integration/list-job-offers.spec.js b/cypress/integration/list-job-offers.spec.js index badf05d..8def06b 100644 --- a/cypress/integration/list-job-offers.spec.js +++ b/cypress/integration/list-job-offers.spec.js @@ -30,7 +30,12 @@ context('List Job Offers Browser Testing', () => { let listingTitle, listingDesccription, listingCount; - it('should visit the job offers listing screen', () => cy.naviagte('/job-offers')); + it('should visit the job offers listing screen', () => { + cy.visit('/job-offers'); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/job-offers'); + }); + }); it('should get the listing count', () => { cy.get(listingCountQuery.join(' ')).its('length').then(length => listingCount = length); }); diff --git a/cypress/integration/list-users.spec.js b/cypress/integration/list-users.spec.js index 9db3595..ddd848e 100644 --- a/cypress/integration/list-users.spec.js +++ b/cypress/integration/list-users.spec.js @@ -33,7 +33,12 @@ context('List Users Browser Testing', () => { listingJob, listingCity, listingCount; - it('should visit the users listing screen', () => cy.naviagte('/members')); + it('should visit the users listing screen', () => { + cy.visit('/members'); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/members'); + }); + }); it('should get the listing count', () => { cy.get(listingCountQuery.join(' ')).invoke('text').then(text => listingCount = text); }); diff --git a/cypress/integration/retire-channel.spec.js b/cypress/integration/retire-channel.spec.js index 6f0a659..6ae42d2 100644 --- a/cypress/integration/retire-channel.spec.js +++ b/cypress/integration/retire-channel.spec.js @@ -23,12 +23,20 @@ context('Retire Channel Browser Testing', () => { it('should login', () => cy.login()); describe('Channel Retirement process', () => { let channelsLength; - it('should visit the channels list screen', () => cy.naviagte('/admin')); + it('should visit the channels list screen', () => { + cy.visit('/admin'); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/admin'); + }); + }); it('should visit the last channel edit screen', () => { cy.get(menuQuery.join(' ')) .invoke('attr', 'data-src') .then(url => cy.encodeUrl(url).then(id => { - cy.naviagte('/circle/@' + id + '/circle-information/circle-edit'); + cy.visit('/circle/@' + id + '/circle-information/circle-edit'); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/circle/@' + id + '/circle-information/circle-edit'); + }); })); }); it('should count the number of joined channels', () => { diff --git a/cypress/integration/retire-project.spec.js b/cypress/integration/retire-project.spec.js index a660395..b54b90d 100644 --- a/cypress/integration/retire-project.spec.js +++ b/cypress/integration/retire-project.spec.js @@ -23,12 +23,20 @@ context('Retire Project Browser Testing', () => { it('should login', () => cy.login()); describe('Project Retirement process', () => { let projectsLength; - it('should visit the projects list screen', () => cy.naviagte('/admin/admin-projects')); + it('should visit the projects list screen', () => { + cy.visit('/admin/admin-projects'); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/admin/admin-projects'); + }); + }); it('should visit the last project edit screen', () => { cy.get(menuQuery.join(' ')) .invoke('attr', 'data-src') .then(url => cy.encodeUrl(url).then(id => { - cy.naviagte('/project/@' + id + '/project-information/project-edit'); + cy.visit('/project/@' + id + '/project-information/project-edit'); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/project/@' + id + '/project-information/project-edit'); + }); })); }); it('should count the number of joined projects', () => { diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 2ece0ad..cff3858 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -43,13 +43,6 @@ Cypress.Commands.add('login', () => { }); }); -Cypress.Commands.add('naviagte', route => { - cy.visit(route); - cy.location().should((loc) => { - expect(loc.pathname).to.eq(route); - }); -}); - Cypress.Commands.add('userLogin', () => { cy.visit('/'); cy.location().should((loc) => {