From e5e2815f0d484fd3b28278c05a895e585f3aee60 Mon Sep 17 00:00:00 2001 From: Jure Ursic Date: Tue, 30 Jun 2020 14:27:20 +0200 Subject: [PATCH 01/39] feature: User creattion and signup test flows --- cypress/integration/create-user.spec.js | 79 +++++++++++++++++++++++++ cypress/integration/signup.spec.js | 59 ++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 cypress/integration/create-user.spec.js create mode 100644 cypress/integration/signup.spec.js diff --git a/cypress/integration/create-user.spec.js b/cypress/integration/create-user.spec.js new file mode 100644 index 0000000..2670ba8 --- /dev/null +++ b/cypress/integration/create-user.spec.js @@ -0,0 +1,79 @@ +/// +/* globals cy, expect */ + +context('Creat User Browser Testing', () => { + const firstName = 'First', + lastName = 'Last', + username = 'testuser_creation_' + Math.floor(1000 + Math.random() * 9000), + email = username + '@testemail.com'; + before(() => { + cy.clearLocalStorage({ domain: null}); + cy.clearCookies({ domain: null }); + }); + it('visit the homepage', () => { + cy.visit('/'); + }); + it('should await for an user login', () => { + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/auth/login/'); + }); + }); + describe('User Creation process', () => { + it('should login', () => { + cy.get('#id_username').type('admin'); + cy.get('#id_username').should('have.value', 'admin'); + cy.get('#id_password').type('admin'); + cy.get('#id_password').should('have.value', 'admin'); + cy.get('.connection-btn').click(); + cy.get('.accept-button').click(); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/'); + }); + }); + 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'); + }); + // Workaround - seems to be a bug when accessing the route directly + cy.get('.accept-button').click(); + // End workaround + }); + /*it('should enter erroneous user data and submit', () => { + cy.get('#admin-users-create input[name="first_name"]').type(firstName); + cy.get('#admin-users-create input[name="first_name"]').should('have.value', firstName); + cy.get('#admin-users-create input[name="last_name"]').type(lastName); + cy.get('#admin-users-create input[name="last_name"]').should('have.value', lastName); + cy.get('#admin-users-create input[name="username"]').type('!"#$%&'); + cy.get('#admin-users-create input[name="username"]').should('have.value', '!"#$%&'); + cy.get('#admin-users-create input[name="email"]').type(email.split('.')[0]); + cy.get('#admin-users-create input[name="email"]').should('have.value', email.split('.')[0]); + }); + it('should click on create user button', () => { + cy.get('#admin-users-create input[type="submit"]').click(); + }); + it('should provide errors about erroneous user data', () => { + // TO-DO: Check for error messages + cy.get('element') + .should('contain.text', 'Error message.'); + });*/ + it('should enter user data and submit', () => { + 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); + cy.get('#admin-users-create input[name="last_name"]').clear().type(lastName); + cy.get('#admin-users-create input[name="last_name"]').should('have.value', lastName); + cy.get('#admin-users-create input[name="username"]').clear().type(username); + cy.get('#admin-users-create input[name="username"]').should('have.value', username); + cy.get('#admin-users-create input[name="email"]').clear().type(email); + cy.get('#admin-users-create input[name="email"]').should('have.value', email); + }); + it('should click on create user button', () => { + cy.get('#admin-users-create input[type="submit"]').click(); + }); + it('should land on users list screen', () => { + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/admin/admin-users'); + }); + }); + }); +}); diff --git a/cypress/integration/signup.spec.js b/cypress/integration/signup.spec.js new file mode 100644 index 0000000..4a77c44 --- /dev/null +++ b/cypress/integration/signup.spec.js @@ -0,0 +1,59 @@ +/// +/* globals cy, expect */ + +context('Signup Browser Testing', () => { + const username = 'testuser_signup_' + Math.floor(1000 + Math.random() * 9000), + email = username + '@testemail.com', + password = 'testpwd'; + before(() => { + cy.clearLocalStorage({ domain: null }); + cy.clearCookies({ domain: null }); + }); + it('visit the homepage', () => { + cy.visit('/'); + }); + it('should await for an user login', () => { + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/auth/login/'); + }); + }); + describe('Signup process', () => { + it('should click on signup page link', () => { + cy.get('.sib-link.sib-register-link').click(); + }); + it('should write erroneous user data', () => { + cy.get('#id_username').type('!"#$%&'); + cy.get('#id_username').should('have.value', '!"#$%&'); + cy.get('#id_email').type(email.split('.')[0]); + cy.get('#id_email').should('have.value', email.split('.')[0]); + cy.get('#id_password1').type(password + 'wrong1'); + cy.get('#id_password1').should('have.value', password + 'wrong1'); + cy.get('#id_password2').type(password + 'wrong2'); + cy.get('#id_password2').should('have.value', password + 'wrong2'); + }); + it('should click on signup button', () => { + cy.get('.sib-registration-btn').click(); + }); + it('should provide errors about erroneous user data', () => { + cy.get('tbody tr:nth-child(1) ul.errorlist li') + .should('contain.text', 'Enter a valid username. This value may contain only letters, numbers, and ./+/-/_ characters.'); + cy.get('tbody tr:nth-child(2) ul.errorlist li') + .should('contain.text', 'Enter a valid email address.'); + cy.get('tbody tr:nth-child(4) ul.errorlist li') + .should('contain.text', 'The two password fields didn\'t match.'); + }); + it('should write correct user data', () => { + cy.get('#id_username').clear().type(username); + cy.get('#id_username').should('have.value', username); + cy.get('#id_email').clear().type(email); + cy.get('#id_email').should('have.value', email); + cy.get('#id_password1').clear().type(password); + cy.get('#id_password1').should('have.value', password); + cy.get('#id_password2').clear().type(password); + cy.get('#id_password2').should('have.value', password); + }); + it('should click on signup button', () => { + cy.get('.sib-registration-btn').click(); + }); + }); +}); From 8b84de7b37eeca6991eb2c0a6bdd30923a2c38a8 Mon Sep 17 00:00:00 2001 From: Jure Ursic Date: Fri, 3 Jul 2020 19:25:23 +0200 Subject: [PATCH 02/39] feature: user, project, channel and job offer create test flows and project, channel and job offer edit test flows --- cypress/fixtures/admin.json | 4 ++ cypress/integration/create-channel.spec.js | 58 +++++++++++++++++ cypress/integration/create-job-offer.spec.js | 64 +++++++++++++++++++ cypress/integration/create-project.spec.js | 64 +++++++++++++++++++ cypress/integration/create-user.spec.js | 59 +++++++---------- cypress/integration/edit-channel.spec.js | 58 +++++++++++++++++ cypress/integration/edit-job-offer.spec.js | 59 +++++++++++++++++ cypress/integration/edit-project.spec.js | 62 ++++++++++++++++++ cypress/integration/retire-project.spec.js | 35 ++++++++++ .../{tests.spec.js => signin.spec.js} | 60 ++++++++--------- cypress/integration/signup.spec.js | 29 +++++---- cypress/support/commands.js | 55 ++++++++++++++++ cypress/support/index.js | 15 +++-- 13 files changed, 533 insertions(+), 89 deletions(-) create mode 100644 cypress/fixtures/admin.json create mode 100644 cypress/integration/create-channel.spec.js create mode 100644 cypress/integration/create-job-offer.spec.js create mode 100644 cypress/integration/create-project.spec.js create mode 100644 cypress/integration/edit-channel.spec.js create mode 100644 cypress/integration/edit-job-offer.spec.js create mode 100644 cypress/integration/edit-project.spec.js create mode 100644 cypress/integration/retire-project.spec.js rename cypress/integration/{tests.spec.js => signin.spec.js} (70%) diff --git a/cypress/fixtures/admin.json b/cypress/fixtures/admin.json new file mode 100644 index 0000000..fb25ded --- /dev/null +++ b/cypress/fixtures/admin.json @@ -0,0 +1,4 @@ +{ + "username": "admin", + "password": "admin" +} \ No newline at end of file diff --git a/cypress/integration/create-channel.spec.js b/cypress/integration/create-channel.spec.js new file mode 100644 index 0000000..8a89d97 --- /dev/null +++ b/cypress/integration/create-channel.spec.js @@ -0,0 +1,58 @@ +/// +/* globals cy, expect */ + +context('Create Channel Browser Testing', () => { + let channelName = 'Test Channel ', + description = 'Test Description '; + before(() => { + cy.randomNum().then(num => { + channelName += num; + description += num; + }); + cy.clearLocalStorage({ domain: null }); + cy.clearCookies({ domain: null }); + }); + it('should visit user login screen', () => cy.userLogin()); + describe('Channel Creation process', () => { + it('should login', () => cy.login()); + it('should visit the channel creation screen', () => cy.naviagte('/admin/admin-circle-create')); + /*it('should enter incorrect channel data', () => { + cy.get('#admin-circle-create input[name="name"]').type('!"#$%&'); + cy.get('#admin-circle-create input[name="name"]').should('have.value', '!"#$%&'); + cy.get('#admin-circle-create input[name="description"]').type(description); + cy.get('#admin-circle-create input[name="description"]').should('have.value', description); + }); + it('should click on create channel button', () => { + cy.get('#admin-circle-create input[type="submit"]').click(); + }); + it('should provide errors about incorrect channel data', () => { + // TO-DO: Check for error messages + cy.get('element') + .should('contain.text', 'Error message.'); + });*/ + it('should enter correct channel data', () => { + cy.get('#admin-circle-create input[name="name"]').clear().type(channelName); + cy.get('#admin-circle-create input[name="name"]').should('have.value', channelName); + cy.get('#admin-circle-create input[name="description"]').clear().type(description); + cy.get('#admin-circle-create input[name="description"]').should('have.value', description); + }); + it('should click on create channel button', () => { + cy.get('#admin-circle-create input[type="submit"]').click(); + }); + it('should land on channels list screen', () => { + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/admin'); + }); + // Workaround - component reactivity bug + cy.reload(); + cy.get('.accept-button').click(); + // End workaround + }); + it('should land newly created channel on channels list screen', () => { + cy.contains('solid-display-value[name="circle.name"]', channelName).should("exist"); + cy.fixture('admin.json').then(admin => { + cy.contains('solid-display-value[name="username"]', admin.username).should("exist"); + }); + }); + }); +}); diff --git a/cypress/integration/create-job-offer.spec.js b/cypress/integration/create-job-offer.spec.js new file mode 100644 index 0000000..f968154 --- /dev/null +++ b/cypress/integration/create-job-offer.spec.js @@ -0,0 +1,64 @@ +/// +/* globals cy, expect */ + +context('Create Job Offer Browser Testing', () => { + let jobDate = '', + jobTitle = 'Test Job Offer ', + description = 'Test Description '; + before(() => { + cy.nextYear(1).then(year => { + jobDate = year + '-12-31'; + }); + cy.randomNum().then(num => { + jobTitle += num; + description += num; + }); + cy.clearLocalStorage({ domain: null }); + cy.clearCookies({ domain: null }); + }); + it('should visit user login screen', () => cy.userLogin()); + describe('Job Offer Creation process', () => { + it('should login', () => cy.login()); + it('should visit the job offer creation screen', () => cy.naviagte('/job-offers/job-offers-create')); + /*it('should enter incorrect job offer data', () => { + cy.get('#job-offers-create input[name="closingDate"]').type('!"#$%&'); + cy.get('#job-offers-create input[name="closingDate"]').should('have.value', '!"#$%&'); + cy.get('#job-offers-create input[name="title"]').type('!"#$%&'); + cy.get('#job-offers-create input[name="title"]').should('have.value', '!"#$%&'); + cy.get('#job-offers-create textarea[name="description"]').type(description); + cy.get('#job-offers-create textarea[name="description"]').should('have.value', description); + }); + it('should click on create job offer button', () => { + cy.get('#job-offers-create input[type="submit"]').click(); + }); + it('should provide errors about incorrect job offer data', () => { + // TO-DO: Check for error messages + cy.get('element') + .should('contain.text', 'Error message.'); + });*/ + 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); + cy.get('#job-offers-create input[name="title"]').clear().type(jobTitle); + cy.get('#job-offers-create input[name="title"]').should('have.value', jobTitle); + cy.get('#job-offers-create textarea[name="description"]').clear().type(description); + cy.get('#job-offers-create textarea[name="description"]').should('have.value', description); + }); + it('should click on create job offer button', () => { + cy.get('#job-offers-create input[type="submit"]').click(); + }); + it('should land on job offers list screen', () => { + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/job-offers'); + }); + // Workaround - component reactivity bug + cy.reload(); + cy.get('.accept-button').click(); + // End workaround + }); + it('should land newly created job offer on job offers list screen', () => { + cy.contains('solid-display-value[name="title"]', jobTitle).should("exist"); + cy.contains('solid-display-value[name="description"]', description).should("exist"); + }); + }); +}); diff --git a/cypress/integration/create-project.spec.js b/cypress/integration/create-project.spec.js new file mode 100644 index 0000000..65af225 --- /dev/null +++ b/cypress/integration/create-project.spec.js @@ -0,0 +1,64 @@ +/// +/* globals cy, expect */ + +context('Create Project Browser Testing', () => { + let projectName = 'Test Project ', + customerName = 'Test Customer ', + description = 'Test Description '; + before(() => { + cy.randomNum().then(num => { + projectName += num; + customerName += num; + description += num; + }); + cy.clearLocalStorage({ domain: null }); + cy.clearCookies({ domain: null }); + }); + it('should visit user login screen', () => cy.userLogin()); + describe('Project Creation process', () => { + it('should login', () => cy.login()); + it('should visit the project creation screen', () => cy.naviagte('/admin/admin-projects/admin-project-create')); + /*it('should enter incorrect project data', () => { + cy.get('#admin-project-create input[name="customer.name"]').type('!"#$%&'); + cy.get('#admin-project-create input[name="customer.name"]').should('have.value', '!"#$%&'); + cy.get('#admin-project-create input[name="name"]').type('!"#$%&'); + cy.get('#admin-project-create input[name="name"]').should('have.value', '!"#$%&'); + cy.get('#admin-project-create textarea[name="description"]').type(description); + cy.get('#admin-project-create textarea[name="description"]').should('have.value', description); + }); + it('should click on create project button', () => { + cy.get('#admin-project-create input[type="submit"]').click(); + }); + it('should provide errors about incorrect project data', () => { + // TO-DO: Check for error messages + cy.get('element') + .should('contain.text', 'Error message.'); + });*/ + it('should enter correct project data', () => { + cy.get('#admin-project-create input[name="customer.name"]').clear().type(customerName); + cy.get('#admin-project-create input[name="customer.name"]').should('have.value', customerName); + cy.get('#admin-project-create input[name="name"]').clear().type(projectName); + cy.get('#admin-project-create input[name="name"]').should('have.value', projectName); + cy.get('#admin-project-create textarea[name="description"]').clear().type(description); + cy.get('#admin-project-create textarea[name="description"]').should('have.value', description); + }); + it('should click on create project button', () => { + cy.get('#admin-project-create input[type="submit"]').click(); + }); + it('should land on projects list screen', () => { + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/admin/admin-projects'); + }); + // Workaround - component reactivity bug + cy.reload(); + cy.get('.accept-button').click(); + // End workaround + }); + it('should land newly created project on projects list screen', () => { + cy.contains('solid-display-value[name="project.name"]', projectName).should("exist"); + cy.fixture('admin.json').then(admin => { + cy.contains('solid-display-value[name="username"]', admin.username).should("exist"); + }); + }); + }); +}); diff --git a/cypress/integration/create-user.spec.js b/cypress/integration/create-user.spec.js index 2670ba8..b6dc322 100644 --- a/cypress/integration/create-user.spec.js +++ b/cypress/integration/create-user.spec.js @@ -1,45 +1,26 @@ /// /* globals cy, expect */ -context('Creat User Browser Testing', () => { - const firstName = 'First', - lastName = 'Last', - username = 'testuser_creation_' + Math.floor(1000 + Math.random() * 9000), - email = username + '@testemail.com'; +context('Create User Browser Testing', () => { + let firstName = 'First ', + lastName = 'Last ', + username = 'testuser_creation_', + email = ''; before(() => { - cy.clearLocalStorage({ domain: null}); + cy.randomNum().then(num => { + firstName += num; + lastName += num; + username += num; + email = username + '@testemail.com'; + }); + cy.clearLocalStorage({ domain: null }); cy.clearCookies({ domain: null }); }); - it('visit the homepage', () => { - cy.visit('/'); - }); - it('should await for an user login', () => { - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/auth/login/'); - }); - }); + it('should visit user login screen', () => cy.userLogin()); describe('User Creation process', () => { - it('should login', () => { - cy.get('#id_username').type('admin'); - cy.get('#id_username').should('have.value', 'admin'); - cy.get('#id_password').type('admin'); - cy.get('#id_password').should('have.value', 'admin'); - cy.get('.connection-btn').click(); - cy.get('.accept-button').click(); - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/'); - }); - }); - 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'); - }); - // Workaround - seems to be a bug when accessing the route directly - cy.get('.accept-button').click(); - // End workaround - }); - /*it('should enter erroneous user data and submit', () => { + it('should login', () => cy.login()); + it('should visit the user creation screen', () => cy.naviagte('/admin/admin-users/admin-users-create')); + /*it('should enter incorrect user data', () => { cy.get('#admin-users-create input[name="first_name"]').type(firstName); cy.get('#admin-users-create input[name="first_name"]').should('have.value', firstName); cy.get('#admin-users-create input[name="last_name"]').type(lastName); @@ -52,12 +33,12 @@ context('Creat User Browser Testing', () => { it('should click on create user button', () => { cy.get('#admin-users-create input[type="submit"]').click(); }); - it('should provide errors about erroneous user data', () => { + it('should provide errors about incorrect user data', () => { // TO-DO: Check for error messages cy.get('element') .should('contain.text', 'Error message.'); });*/ - it('should enter user data and submit', () => { + 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); cy.get('#admin-users-create input[name="last_name"]').clear().type(lastName); @@ -75,5 +56,9 @@ context('Creat User Browser Testing', () => { expect(loc.pathname).to.eq('/admin/admin-users'); }); }); + it('should land newly created user on users list screen', () => { + cy.contains('solid-display-value[name="name"]', firstName + ' ' + lastName).should("exist"); + cy.contains('solid-display-value[name="username"]', username).should("exist"); + }); }); }); diff --git a/cypress/integration/edit-channel.spec.js b/cypress/integration/edit-channel.spec.js new file mode 100644 index 0000000..32a702a --- /dev/null +++ b/cypress/integration/edit-channel.spec.js @@ -0,0 +1,58 @@ +/// +/* globals cy, expect */ + +context('Edit Channel Browser Testing', () => { + let channelName = 'Edited Test Channel ', + description = 'Edited Test Description ', + menuQuery = [ + 'solid-display.circle-tab', + 'solid-display:last-child', + 'solid-display[order-by="name"]' + ]; + before(() => { + cy.randomNum().then(num => { + channelName += num; + description += num; + }); + cy.clearLocalStorage({ domain: null }); + cy.clearCookies({ domain: null }); + }); + it('should visit user login screen', () => cy.userLogin()); + describe('Channel Edition process', () => { + it('should login', () => cy.login()); + it('should visit the channel list screen', () => cy.naviagte('/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'); + })); + }); + it('should enter new channel data', () => { + cy.get('#circle-edit input[name="name"]').clear().type(channelName); + cy.get('#circle-edit input[name="name"]').should('have.value', channelName); + cy.get('#circle-edit input[name="description"]').clear().type(description); + cy.get('#circle-edit input[name="description"]').should('have.value', description); + }); + it('should click button to save the channel', () => { + cy.get('#circle-edit input[value="Enregistrer"]').click(); + }); + it('should land on channel information screen', () => { + cy.get(menuQuery.join(' ')) + .invoke('attr', 'data-src') + .then(url => cy.encodeUrl(url).then(id => { + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/circle/@' + id + '/circle-information'); + }); + })); + // Workaround - component reactivity bug + cy.reload(); + cy.get('.accept-button').click(); + // End workaround + }); + it('should show edited channel data on channel information screen', () => { + cy.contains('solid-display-value[name="name"]', channelName).should("exist"); + cy.contains('solid-display-value[name="description"]', description).should("exist"); + }); + }); +}); diff --git a/cypress/integration/edit-job-offer.spec.js b/cypress/integration/edit-job-offer.spec.js new file mode 100644 index 0000000..10a7b27 --- /dev/null +++ b/cypress/integration/edit-job-offer.spec.js @@ -0,0 +1,59 @@ +/// +/* globals cy, expect */ + +context('Edit Job Offer Browser Testing', () => { + let jobDate = '', + jobTitle = 'Edited Test Job Offer ', + description = 'Edited Test Description ', + menuQuery = [ + 'solid-display.job-board__list', + 'solid-display:last-child' + ]; + before(() => { + cy.nextYear(2).then(year => { + jobDate = year + '-12-31'; + }); + cy.randomNum().then(num => { + jobTitle += num; + description += num; + }); + cy.clearLocalStorage({ domain: null }); + cy.clearCookies({ domain: null }); + }); + it('should visit user login screen', () => cy.userLogin()); + describe('Job Offer Edition process', () => { + it('should login', () => cy.login()); + it('should visit the job offers list screen', () => cy.naviagte('/job-offers')); + 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('/job-offers/job-offers-edit/@' + id); + })); + }); + it('should enter new job offer data', () => { + cy.get('#job-offers-edit input[name="closingDate"]').clear().type(jobDate); + cy.get('#job-offers-edit input[name="closingDate"]').should('have.value', jobDate); + cy.get('#job-offers-edit input[name="title"]').clear().type(jobTitle); + cy.get('#job-offers-edit input[name="title"]').should('have.value', jobTitle); + cy.get('#job-offers-edit textarea[name="description"]').clear().type(description); + cy.get('#job-offers-edit textarea[name="description"]').should('have.value', description); + }); + it('should click button to save the job offer', () => { + cy.get('#job-offers-edit input[type="submit"]').click(); + }); + it('should land on job offers list screen', () => { + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/job-offers'); + }); + // Workaround - component reactivity bug + cy.reload(); + cy.get('.accept-button').click(); + // End workaround + }); + it('should show edited project data on project information screen', () => { + cy.contains('solid-display-value[name="title"]', jobTitle).should("exist"); + cy.contains('solid-display-value[name="description"]', description).should("exist"); + }); + }); +}); diff --git a/cypress/integration/edit-project.spec.js b/cypress/integration/edit-project.spec.js new file mode 100644 index 0000000..e7a532d --- /dev/null +++ b/cypress/integration/edit-project.spec.js @@ -0,0 +1,62 @@ +/// +/* globals cy, expect */ + +context('Edit Project Browser Testing', () => { + let projectName = 'Edited Test Project ', + customerName = 'Edited Test Customer ', + description = 'Edited Test Description ', + menuQuery = [ + 'solid-display.project-tab', + 'solid-display:last-child', + 'solid-display[order-by="customer.name"]' + ]; + before(() => { + cy.randomNum().then(num => { + projectName += num; + customerName += num; + description += num; + }); + cy.clearLocalStorage({ domain: null }); + cy.clearCookies({ domain: null }); + }); + it('should visit user login screen', () => cy.userLogin()); + describe('Project Edition process', () => { + it('should login', () => cy.login()); + it('should visit the project list screen', () => cy.naviagte('/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'); + })); + }); + it('should enter new project data', () => { + cy.get('#project-edit input[name="customer.name"]').clear().type(customerName); + cy.get('#project-edit input[name="customer.name"]').should('have.value', customerName); + cy.get('#project-edit input[name="name"]').clear().type(projectName); + cy.get('#project-edit input[name="name"]').should('have.value', projectName); + cy.get('#project-edit textarea[name="description"]').clear().type(description); + cy.get('#project-edit textarea[name="description"]').should('have.value', description); + }); + it('should click button to save the project', () => { + cy.get('#project-edit input[value="Enregistrer"]').click(); + }); + it('should land on project information screen', () => { + cy.get(menuQuery.join(' ')) + .invoke('attr', 'data-src') + .then(url => cy.encodeUrl(url).then(id => { + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/project/@' + id + '/project-information'); + }); + })); + // Workaround - component reactivity bug + cy.reload(); + cy.get('.accept-button').click(); + // End workaround + }); + it('should show edited project data on project information screen', () => { + cy.contains('solid-display-value[name="customer.name"]', customerName).should("exist"); + cy.contains('solid-display-value[name="name"]', projectName).should("exist"); + }); + }); +}); diff --git a/cypress/integration/retire-project.spec.js b/cypress/integration/retire-project.spec.js new file mode 100644 index 0000000..0584d6e --- /dev/null +++ b/cypress/integration/retire-project.spec.js @@ -0,0 +1,35 @@ +/// +/* globals cy, expect */ + +context('Retire Project Browser Testing', () => { + before(() => { + cy.clearLocalStorage({ domain: null }); + cy.clearCookies({ domain: null }); + }); + it('should visit user login screen', () => cy.userLogin()); + describe('Project Retirement process', () => { + it('should login', () => cy.login()); + it('should visit the project creation screen', () => cy.naviagte('/admin/admin-projects')); + it('should visit the last project edit screen', () => { + cy.get('solid-display[widget-project="hubl-menu-fix-url-project"][fields="project"]:last-child solid-display') + .invoke('attr', 'data-src') + .then(url => cy.encodeUrl(url).then(id => { + cy.naviagte('/project/@' + id + '/project-information/project-edit'); + })); + }); + it('should click button to retire the project', () => { + cy.scrollTo('bottom'); + cy.get('solid-delete[data-label="Retirer"] button').click(); + }); + it('should stay on project edit screen', () => { + cy.get('solid-display[widget-project="hubl-menu-fix-url-project"]:last-child solid-display') + .invoke('attr', 'data-src') + .then(url => cy.encodeUrl(url).then(id => { + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/project/@' + id + '/project-information/project-edit'); + }); + })); + }); + // TO-DO: ceraify what needs to happen after and do the checks + }); +}); diff --git a/cypress/integration/tests.spec.js b/cypress/integration/signin.spec.js similarity index 70% rename from cypress/integration/tests.spec.js rename to cypress/integration/signin.spec.js index ba53571..62e1265 100644 --- a/cypress/integration/tests.spec.js +++ b/cypress/integration/signin.spec.js @@ -1,43 +1,36 @@ /// - +/* globals cy, expect */ context('Browser testing', () => { - before(() => { - cy.clearLocalStorage({ domain: null}); - cy.clearCookies({ domain: null }); + before(() => { + cy.clearLocalStorage({ domain: null}); + cy.clearCookies({ domain: null }); + }); + it('should visit user login screen', () => cy.userLogin()); + describe('Login process', () => { + it('should write "admin" on username field and "password" on password field', () => { + cy.get('#id_username').type('admin'); + cy.get('#id_username').should('have.value', 'admin'); + cy.get('#id_password').type('password'); + cy.get('#id_password').should('have.value', 'password'); }); - it('visit the homepage', () => { - cy.visit('/'); + it('should click on login button', () => { + cy.get(':nth-child(1) > .flex-column > [type="submit"]').click(); }); - it('should await for an user login', () => { + it('should provide an error, username and password mismatch.', () => { + cy.get('.error').should('contain.text', 'Ton nom d\'utilisateur et ton mot de passe ne correspondent pas. Réessaye.'); + }); + it('should write "admin" on password field then press the login button', () => { + cy.get('#id_password').type('admin'); + cy.get('#id_password').should('have.value', 'admin'); + cy.get(':nth-child(1) > .flex-column > [type="submit"]').click(); + }); + it('should ask for user permission to access their datas.', () => { cy.location().should((loc) => { - expect(loc.pathname).to.eq('/auth/login/'); + expect(loc.pathname).to.eq('/authorize'); }); + cy.get('.accept-button').click(); }); - describe('Login process', () => { - it('should write "admin" on username field and "password" on password field', () => { - cy.get('#id_username').type('admin'); - cy.get('#id_username').should('have.value', 'admin'); - cy.get('#id_password').type('password'); - cy.get('#id_password').should('have.value', 'password'); - }); - it('should click on login button', () => { - cy.get(':nth-child(1) > .flex-column > [type="submit"]').click(); - }); - it('should provide an error, username and password mismatch.', () => { - cy.get('.error').should('contain.text', 'Ton nom d\'utilisateur et ton mot de passe ne correspondent pas. Réessaye.') - }); - it('should write "admin" on password field then press the login button', () => { - cy.get('#id_password').type('admin'); - cy.get('#id_password').should('have.value', 'admin'); - cy.get(':nth-child(1) > .flex-column > [type="submit"]').click(); - }); - it('should ask for user permission to access their datas.', () => { - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/authorize') - }); - cy.get('.accept-button').click(); - }); // it('should redirect the user to the app.', () => { // cy.get('.accept-button').click(); // cy.location().should((loc) => { @@ -103,6 +96,5 @@ context('Browser testing', () => { // expect(loc.pathname).to.eq('/auth/login/'); // }); // }); - }); }); - +}); diff --git a/cypress/integration/signup.spec.js b/cypress/integration/signup.spec.js index 4a77c44..9597980 100644 --- a/cypress/integration/signup.spec.js +++ b/cypress/integration/signup.spec.js @@ -1,27 +1,24 @@ /// -/* globals cy, expect */ +/* globals cy */ context('Signup Browser Testing', () => { - const username = 'testuser_signup_' + Math.floor(1000 + Math.random() * 9000), - email = username + '@testemail.com', - password = 'testpwd'; + let username = 'testuser_creation_', + email = '', + password = 'testpwd'; before(() => { + cy.randomNum().then(num => { + username += num; + email = username + '@testemail.com'; + }); cy.clearLocalStorage({ domain: null }); cy.clearCookies({ domain: null }); }); - it('visit the homepage', () => { - cy.visit('/'); - }); - it('should await for an user login', () => { - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/auth/login/'); - }); - }); + it('should visit user login screen', () => cy.userLogin()); describe('Signup process', () => { it('should click on signup page link', () => { cy.get('.sib-link.sib-register-link').click(); }); - it('should write erroneous user data', () => { + it('should write incorrect user data', () => { cy.get('#id_username').type('!"#$%&'); cy.get('#id_username').should('have.value', '!"#$%&'); cy.get('#id_email').type(email.split('.')[0]); @@ -34,7 +31,7 @@ context('Signup Browser Testing', () => { it('should click on signup button', () => { cy.get('.sib-registration-btn').click(); }); - it('should provide errors about erroneous user data', () => { + it('should provide errors about incorrect user data', () => { cy.get('tbody tr:nth-child(1) ul.errorlist li') .should('contain.text', 'Enter a valid username. This value may contain only letters, numbers, and ./+/-/_ characters.'); cy.get('tbody tr:nth-child(2) ul.errorlist li') @@ -55,5 +52,9 @@ context('Signup Browser Testing', () => { it('should click on signup button', () => { cy.get('.sib-registration-btn').click(); }); + it('should show email confirmation dialog', () => { + cy.contains('h1.text-center', 'Un e-mail d\'activation a été envoyé.').should("exist"); + cy.contains('p.text-center', 'Vérifie ta boite mail et clique sur le lien pour activer ton compte.').should("exist"); + }); }); }); diff --git a/cypress/support/commands.js b/cypress/support/commands.js index ca4d256..1450915 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -23,3 +23,58 @@ // // -- This will overwrite an existing command -- // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) + +/* globals Cypress, cy, expect */ + +Cypress.Commands.add('login', () => { + cy.fixture('admin.json').then(admin => { + cy.get('#id_username').type(admin.username); + cy.get('#id_username').should('have.value', admin.username); + cy.get('#id_password').type(admin.password); + cy.get('#id_password').should('have.value', admin.password); + cy.get('.connection-btn').click(); + cy.get('.accept-button').click(); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/'); + }); + }); +}); + +Cypress.Commands.add('naviagte', route => { + cy.visit(route); + cy.location().should((loc) => { + expect(loc.pathname).to.eq(route); + }); + // Workaround - seems to be a bug when accessing the route directly + cy.get('.accept-button').click(); + cy.wait(2000); + // End workaround +}); + +Cypress.Commands.add('userLogin', () => { + cy.visit('/'); + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/auth/login/'); + }); +}); + +Cypress.Commands.add('encodeUrl', url => { + const encodeIdReplacement = [ + ['~', '~~'], + ['.', '~!'], + [':', '~@'], + ['/', '~_'], + ]; + encodeIdReplacement.forEach(([char, repl]) => { + url = url.split(char).join(repl); + }); + return url; +}); + +Cypress.Commands.add('randomNum', () => { + return Math.floor(1000 + Math.random() * 9000); +}); + +Cypress.Commands.add('nextYear', increment => { + return new Date().getFullYear() + ( increment || 1 ); +}); diff --git a/cypress/support/index.js b/cypress/support/index.js index 92fa6f5..cc8bcf0 100644 --- a/cypress/support/index.js +++ b/cypress/support/index.js @@ -13,10 +13,12 @@ // https://on.cypress.io/configuration // *********************************************************** -// Import commands.js using ES2015 syntax: -import './commands' +/* globals Cypress */ -//require('cypress-terminal-report').installSupport(); +// Import commands.js using ES2015 syntax: +import './commands'; + +require('cypress-terminal-report').installSupport(); // Alternatively you can use CommonJS syntax: // require('./commands') @@ -27,4 +29,9 @@ Cypress.on('uncaught:exception', (err, runnable) => { return false; }); -Cypress.on('fail', () => Cypress.runner.abort()) +Cypress.on('fail', (error) => { + console.log(error); + if ( typeof Cypress.runner.abort == 'function' ) { + Cypress.runner.abort(); + } +}); From 6f2a8aa877201831a59cdc4c811f9df06a0c1c9f Mon Sep 17 00:00:00 2001 From: Jure Ursic Date: Fri, 3 Jul 2020 19:27:55 +0200 Subject: [PATCH 03/39] feature: project retire test flow --- cypress/integration/retire-project.spec.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cypress/integration/retire-project.spec.js b/cypress/integration/retire-project.spec.js index 0584d6e..36daa5d 100644 --- a/cypress/integration/retire-project.spec.js +++ b/cypress/integration/retire-project.spec.js @@ -2,16 +2,21 @@ /* globals cy, expect */ context('Retire Project Browser Testing', () => { + let menuQuery = [ + 'solid-display.project-tab', + 'solid-display:last-child', + 'solid-display[order-by="customer.name"]' + ];; before(() => { cy.clearLocalStorage({ domain: null }); cy.clearCookies({ domain: null }); }); - it('should visit user login screen', () => cy.userLogin()); + it('should visit user login screend', () => cy.userLogin()); describe('Project Retirement process', () => { it('should login', () => cy.login()); it('should visit the project creation screen', () => cy.naviagte('/admin/admin-projects')); it('should visit the last project edit screen', () => { - cy.get('solid-display[widget-project="hubl-menu-fix-url-project"][fields="project"]:last-child solid-display') + cy.get(menuQuery.join(' ')) .invoke('attr', 'data-src') .then(url => cy.encodeUrl(url).then(id => { cy.naviagte('/project/@' + id + '/project-information/project-edit'); @@ -22,7 +27,7 @@ context('Retire Project Browser Testing', () => { cy.get('solid-delete[data-label="Retirer"] button').click(); }); it('should stay on project edit screen', () => { - cy.get('solid-display[widget-project="hubl-menu-fix-url-project"]:last-child solid-display') + cy.get(menuQuery.join(' ')) .invoke('attr', 'data-src') .then(url => cy.encodeUrl(url).then(id => { cy.location().should((loc) => { @@ -30,6 +35,6 @@ context('Retire Project Browser Testing', () => { }); })); }); - // TO-DO: ceraify what needs to happen after and do the checks + // TO-DO: clearify what needs to happen after and do the checks }); }); From 2da9de541422a7eeb92b1c8adeec8e532cf32fd8 Mon Sep 17 00:00:00 2001 From: Jure Ursic Date: Fri, 3 Jul 2020 19:40:42 +0200 Subject: [PATCH 04/39] fix: comment out terminal report --- cypress/support/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/index.js b/cypress/support/index.js index cc8bcf0..c1a0001 100644 --- a/cypress/support/index.js +++ b/cypress/support/index.js @@ -18,7 +18,7 @@ // Import commands.js using ES2015 syntax: import './commands'; -require('cypress-terminal-report').installSupport(); +//require('cypress-terminal-report').installSupport(); // Alternatively you can use CommonJS syntax: // require('./commands') From ff41638e2b10df5483819a19fb8c5efcd5ec7a20 Mon Sep 17 00:00:00 2001 From: Jure Ursic Date: Wed, 8 Jul 2020 14:03:44 +0200 Subject: [PATCH 05/39] update: background user token persistance --- cypress/integration/create-channel.spec.js | 1 + cypress/integration/create-job-offer.spec.js | 1 + cypress/integration/create-project.spec.js | 1 + cypress/integration/create-user.spec.js | 1 + cypress/integration/edit-channel.spec.js | 1 + cypress/integration/edit-job-offer.spec.js | 1 + cypress/integration/edit-project.spec.js | 1 + cypress/integration/retire-project.spec.js | 1 + cypress/support/commands.js | 11 +++++++---- 9 files changed, 15 insertions(+), 4 deletions(-) diff --git a/cypress/integration/create-channel.spec.js b/cypress/integration/create-channel.spec.js index 8a89d97..ba1eaaf 100644 --- a/cypress/integration/create-channel.spec.js +++ b/cypress/integration/create-channel.spec.js @@ -12,6 +12,7 @@ context('Create Channel Browser Testing', () => { cy.clearLocalStorage({ domain: null }); cy.clearCookies({ domain: null }); }); + beforeEach(() => cy.setToken()); it('should visit user login screen', () => cy.userLogin()); describe('Channel Creation process', () => { it('should login', () => cy.login()); diff --git a/cypress/integration/create-job-offer.spec.js b/cypress/integration/create-job-offer.spec.js index f968154..1c5b225 100644 --- a/cypress/integration/create-job-offer.spec.js +++ b/cypress/integration/create-job-offer.spec.js @@ -16,6 +16,7 @@ context('Create Job Offer Browser Testing', () => { cy.clearLocalStorage({ domain: null }); cy.clearCookies({ domain: null }); }); + beforeEach(() => cy.setToken()); it('should visit user login screen', () => cy.userLogin()); describe('Job Offer Creation process', () => { it('should login', () => cy.login()); diff --git a/cypress/integration/create-project.spec.js b/cypress/integration/create-project.spec.js index 65af225..77652c6 100644 --- a/cypress/integration/create-project.spec.js +++ b/cypress/integration/create-project.spec.js @@ -14,6 +14,7 @@ context('Create Project Browser Testing', () => { cy.clearLocalStorage({ domain: null }); cy.clearCookies({ domain: null }); }); + beforeEach(() => cy.setToken()); it('should visit user login screen', () => cy.userLogin()); describe('Project Creation process', () => { it('should login', () => cy.login()); diff --git a/cypress/integration/create-user.spec.js b/cypress/integration/create-user.spec.js index b6dc322..f2d9416 100644 --- a/cypress/integration/create-user.spec.js +++ b/cypress/integration/create-user.spec.js @@ -16,6 +16,7 @@ context('Create User Browser Testing', () => { cy.clearLocalStorage({ domain: null }); cy.clearCookies({ domain: null }); }); + beforeEach(() => cy.setToken()); it('should visit user login screen', () => cy.userLogin()); describe('User Creation process', () => { it('should login', () => cy.login()); diff --git a/cypress/integration/edit-channel.spec.js b/cypress/integration/edit-channel.spec.js index 32a702a..03f3fc5 100644 --- a/cypress/integration/edit-channel.spec.js +++ b/cypress/integration/edit-channel.spec.js @@ -17,6 +17,7 @@ context('Edit Channel Browser Testing', () => { cy.clearLocalStorage({ domain: null }); cy.clearCookies({ domain: null }); }); + beforeEach(() => cy.setToken()); it('should visit user login screen', () => cy.userLogin()); describe('Channel Edition process', () => { it('should login', () => cy.login()); diff --git a/cypress/integration/edit-job-offer.spec.js b/cypress/integration/edit-job-offer.spec.js index 10a7b27..649a469 100644 --- a/cypress/integration/edit-job-offer.spec.js +++ b/cypress/integration/edit-job-offer.spec.js @@ -20,6 +20,7 @@ context('Edit Job Offer Browser Testing', () => { cy.clearLocalStorage({ domain: null }); cy.clearCookies({ domain: null }); }); + beforeEach(() => cy.setToken()); it('should visit user login screen', () => cy.userLogin()); describe('Job Offer Edition process', () => { it('should login', () => cy.login()); diff --git a/cypress/integration/edit-project.spec.js b/cypress/integration/edit-project.spec.js index e7a532d..31482bb 100644 --- a/cypress/integration/edit-project.spec.js +++ b/cypress/integration/edit-project.spec.js @@ -19,6 +19,7 @@ context('Edit Project Browser Testing', () => { cy.clearLocalStorage({ domain: null }); cy.clearCookies({ domain: null }); }); + beforeEach(() => cy.setToken()); it('should visit user login screen', () => cy.userLogin()); describe('Project Edition process', () => { it('should login', () => cy.login()); diff --git a/cypress/integration/retire-project.spec.js b/cypress/integration/retire-project.spec.js index 36daa5d..102f0a5 100644 --- a/cypress/integration/retire-project.spec.js +++ b/cypress/integration/retire-project.spec.js @@ -11,6 +11,7 @@ context('Retire Project Browser Testing', () => { cy.clearLocalStorage({ domain: null }); cy.clearCookies({ domain: null }); }); + beforeEach(() => cy.setToken()); it('should visit user login screend', () => cy.userLogin()); describe('Project Retirement process', () => { it('should login', () => cy.login()); diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 1450915..6700e64 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -36,19 +36,22 @@ Cypress.Commands.add('login', () => { cy.get('.accept-button').click(); cy.location().should((loc) => { expect(loc.pathname).to.eq('/'); + cy.wrap(Cypress.localStorage.getItem('solid-auth-client')).as('currentUser'); }); }); }); +Cypress.Commands.add('setToken', () => { + if ( this.currentUser ) { + Cypress.localStorage.setItem('solid-auth-client', this.currentUser); + } +}); + Cypress.Commands.add('naviagte', route => { cy.visit(route); cy.location().should((loc) => { expect(loc.pathname).to.eq(route); }); - // Workaround - seems to be a bug when accessing the route directly - cy.get('.accept-button').click(); - cy.wait(2000); - // End workaround }); Cypress.Commands.add('userLogin', () => { From 9a6ea85bbb8f60f57e527e9b882f46b203248ea1 Mon Sep 17 00:00:00 2001 From: Jure Ursic Date: Wed, 8 Jul 2020 15:41:05 +0200 Subject: [PATCH 06/39] update: loccalStorage persistance using externallibrary --- cypress/integration/create-channel.spec.js | 8 +++----- cypress/integration/create-job-offer.spec.js | 8 +++----- cypress/integration/create-project.spec.js | 8 +++----- cypress/integration/create-user.spec.js | 4 +++- cypress/integration/edit-channel.spec.js | 8 +++----- cypress/integration/edit-job-offer.spec.js | 8 +++----- cypress/integration/edit-project.spec.js | 8 +++----- cypress/integration/retire-project.spec.js | 6 ++++-- cypress/integration/signin.spec.js | 1 + cypress/integration/signup.spec.js | 1 + cypress/support/commands.js | 14 +++++--------- package-lock.json | 6 ++++++ package.json | 1 + 13 files changed, 39 insertions(+), 42 deletions(-) diff --git a/cypress/integration/create-channel.spec.js b/cypress/integration/create-channel.spec.js index ba1eaaf..7dda64b 100644 --- a/cypress/integration/create-channel.spec.js +++ b/cypress/integration/create-channel.spec.js @@ -9,10 +9,12 @@ context('Create Channel Browser Testing', () => { channelName += num; description += num; }); + cy.clearLocalStorageSnapshot(); cy.clearLocalStorage({ domain: null }); cy.clearCookies({ domain: null }); }); - beforeEach(() => cy.setToken()); + beforeEach(() => cy.restoreLocalStorage()); + afterEach(() => cy.saveLocalStorage()); it('should visit user login screen', () => cy.userLogin()); describe('Channel Creation process', () => { it('should login', () => cy.login()); @@ -44,10 +46,6 @@ context('Create Channel Browser Testing', () => { cy.location().should((loc) => { expect(loc.pathname).to.eq('/admin'); }); - // Workaround - component reactivity bug - cy.reload(); - cy.get('.accept-button').click(); - // End workaround }); it('should land newly created channel on channels list screen', () => { cy.contains('solid-display-value[name="circle.name"]', channelName).should("exist"); diff --git a/cypress/integration/create-job-offer.spec.js b/cypress/integration/create-job-offer.spec.js index 1c5b225..b4d6d43 100644 --- a/cypress/integration/create-job-offer.spec.js +++ b/cypress/integration/create-job-offer.spec.js @@ -13,10 +13,12 @@ context('Create Job Offer Browser Testing', () => { jobTitle += num; description += num; }); + cy.clearLocalStorageSnapshot(); cy.clearLocalStorage({ domain: null }); cy.clearCookies({ domain: null }); }); - beforeEach(() => cy.setToken()); + beforeEach(() => cy.restoreLocalStorage()); + afterEach(() => cy.saveLocalStorage()); it('should visit user login screen', () => cy.userLogin()); describe('Job Offer Creation process', () => { it('should login', () => cy.login()); @@ -52,10 +54,6 @@ context('Create Job Offer Browser Testing', () => { cy.location().should((loc) => { expect(loc.pathname).to.eq('/job-offers'); }); - // Workaround - component reactivity bug - cy.reload(); - cy.get('.accept-button').click(); - // End workaround }); it('should land newly created job offer on job offers list screen', () => { cy.contains('solid-display-value[name="title"]', jobTitle).should("exist"); diff --git a/cypress/integration/create-project.spec.js b/cypress/integration/create-project.spec.js index 77652c6..9322c21 100644 --- a/cypress/integration/create-project.spec.js +++ b/cypress/integration/create-project.spec.js @@ -11,10 +11,12 @@ context('Create Project Browser Testing', () => { customerName += num; description += num; }); + cy.clearLocalStorageSnapshot(); cy.clearLocalStorage({ domain: null }); cy.clearCookies({ domain: null }); }); - beforeEach(() => cy.setToken()); + beforeEach(() => cy.restoreLocalStorage()); + afterEach(() => cy.saveLocalStorage()); it('should visit user login screen', () => cy.userLogin()); describe('Project Creation process', () => { it('should login', () => cy.login()); @@ -50,10 +52,6 @@ context('Create Project Browser Testing', () => { cy.location().should((loc) => { expect(loc.pathname).to.eq('/admin/admin-projects'); }); - // Workaround - component reactivity bug - cy.reload(); - cy.get('.accept-button').click(); - // End workaround }); it('should land newly created project on projects list screen', () => { cy.contains('solid-display-value[name="project.name"]', projectName).should("exist"); diff --git a/cypress/integration/create-user.spec.js b/cypress/integration/create-user.spec.js index f2d9416..1abd7a1 100644 --- a/cypress/integration/create-user.spec.js +++ b/cypress/integration/create-user.spec.js @@ -13,10 +13,12 @@ context('Create User Browser Testing', () => { username += num; email = username + '@testemail.com'; }); + cy.clearLocalStorageSnapshot(); cy.clearLocalStorage({ domain: null }); cy.clearCookies({ domain: null }); }); - beforeEach(() => cy.setToken()); + beforeEach(() => cy.restoreLocalStorage()); + afterEach(() => cy.saveLocalStorage()); it('should visit user login screen', () => cy.userLogin()); describe('User Creation process', () => { it('should login', () => cy.login()); diff --git a/cypress/integration/edit-channel.spec.js b/cypress/integration/edit-channel.spec.js index 03f3fc5..ea53551 100644 --- a/cypress/integration/edit-channel.spec.js +++ b/cypress/integration/edit-channel.spec.js @@ -14,10 +14,12 @@ context('Edit Channel Browser Testing', () => { channelName += num; description += num; }); + cy.clearLocalStorageSnapshot(); cy.clearLocalStorage({ domain: null }); cy.clearCookies({ domain: null }); }); - beforeEach(() => cy.setToken()); + beforeEach(() => cy.restoreLocalStorage()); + afterEach(() => cy.saveLocalStorage()); it('should visit user login screen', () => cy.userLogin()); describe('Channel Edition process', () => { it('should login', () => cy.login()); @@ -46,10 +48,6 @@ context('Edit Channel Browser Testing', () => { expect(loc.pathname).to.eq('/circle/@' + id + '/circle-information'); }); })); - // Workaround - component reactivity bug - cy.reload(); - cy.get('.accept-button').click(); - // End workaround }); it('should show edited channel data on channel information screen', () => { cy.contains('solid-display-value[name="name"]', channelName).should("exist"); diff --git a/cypress/integration/edit-job-offer.spec.js b/cypress/integration/edit-job-offer.spec.js index 649a469..53d6dca 100644 --- a/cypress/integration/edit-job-offer.spec.js +++ b/cypress/integration/edit-job-offer.spec.js @@ -17,10 +17,12 @@ context('Edit Job Offer Browser Testing', () => { jobTitle += num; description += num; }); + cy.clearLocalStorageSnapshot(); cy.clearLocalStorage({ domain: null }); cy.clearCookies({ domain: null }); }); - beforeEach(() => cy.setToken()); + beforeEach(() => cy.restoreLocalStorage()); + afterEach(() => cy.saveLocalStorage()); it('should visit user login screen', () => cy.userLogin()); describe('Job Offer Edition process', () => { it('should login', () => cy.login()); @@ -47,10 +49,6 @@ context('Edit Job Offer Browser Testing', () => { cy.location().should((loc) => { expect(loc.pathname).to.eq('/job-offers'); }); - // Workaround - component reactivity bug - cy.reload(); - cy.get('.accept-button').click(); - // End workaround }); it('should show edited project data on project information screen', () => { cy.contains('solid-display-value[name="title"]', jobTitle).should("exist"); diff --git a/cypress/integration/edit-project.spec.js b/cypress/integration/edit-project.spec.js index 31482bb..42e1386 100644 --- a/cypress/integration/edit-project.spec.js +++ b/cypress/integration/edit-project.spec.js @@ -16,10 +16,12 @@ context('Edit Project Browser Testing', () => { customerName += num; description += num; }); + cy.clearLocalStorageSnapshot(); cy.clearLocalStorage({ domain: null }); cy.clearCookies({ domain: null }); }); - beforeEach(() => cy.setToken()); + beforeEach(() => cy.restoreLocalStorage()); + afterEach(() => cy.saveLocalStorage()); it('should visit user login screen', () => cy.userLogin()); describe('Project Edition process', () => { it('should login', () => cy.login()); @@ -50,10 +52,6 @@ context('Edit Project Browser Testing', () => { expect(loc.pathname).to.eq('/project/@' + id + '/project-information'); }); })); - // Workaround - component reactivity bug - cy.reload(); - cy.get('.accept-button').click(); - // End workaround }); it('should show edited project data on project information screen', () => { cy.contains('solid-display-value[name="customer.name"]', customerName).should("exist"); diff --git a/cypress/integration/retire-project.spec.js b/cypress/integration/retire-project.spec.js index 102f0a5..e319d83 100644 --- a/cypress/integration/retire-project.spec.js +++ b/cypress/integration/retire-project.spec.js @@ -6,12 +6,14 @@ context('Retire Project Browser Testing', () => { 'solid-display.project-tab', 'solid-display:last-child', 'solid-display[order-by="customer.name"]' - ];; + ]; before(() => { + cy.clearLocalStorageSnapshot(); cy.clearLocalStorage({ domain: null }); cy.clearCookies({ domain: null }); }); - beforeEach(() => cy.setToken()); + beforeEach(() => cy.restoreLocalStorage()); + afterEach(() => cy.saveLocalStorage()); it('should visit user login screend', () => cy.userLogin()); describe('Project Retirement process', () => { it('should login', () => cy.login()); diff --git a/cypress/integration/signin.spec.js b/cypress/integration/signin.spec.js index 62e1265..53457ed 100644 --- a/cypress/integration/signin.spec.js +++ b/cypress/integration/signin.spec.js @@ -3,6 +3,7 @@ context('Browser testing', () => { before(() => { + cy.clearLocalStorageSnapshot(); cy.clearLocalStorage({ domain: null}); cy.clearCookies({ domain: null }); }); diff --git a/cypress/integration/signup.spec.js b/cypress/integration/signup.spec.js index 9597980..05ee1b8 100644 --- a/cypress/integration/signup.spec.js +++ b/cypress/integration/signup.spec.js @@ -10,6 +10,7 @@ context('Signup Browser Testing', () => { username += num; email = username + '@testemail.com'; }); + cy.clearLocalStorageSnapshot(); cy.clearLocalStorage({ domain: null }); cy.clearCookies({ domain: null }); }); diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 6700e64..2ece0ad 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -26,6 +26,8 @@ /* globals Cypress, cy, expect */ +import 'cypress-localstorage-commands'; + Cypress.Commands.add('login', () => { cy.fixture('admin.json').then(admin => { cy.get('#id_username').type(admin.username); @@ -33,20 +35,14 @@ Cypress.Commands.add('login', () => { cy.get('#id_password').type(admin.password); cy.get('#id_password').should('have.value', admin.password); cy.get('.connection-btn').click(); + cy.location('pathname').should('include', '/authorize'); cy.get('.accept-button').click(); - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/'); - cy.wrap(Cypress.localStorage.getItem('solid-auth-client')).as('currentUser'); + cy.location().should(location => { + expect(location.pathname).to.eq('/'); }); }); }); -Cypress.Commands.add('setToken', () => { - if ( this.currentUser ) { - Cypress.localStorage.setItem('solid-auth-client', this.currentUser); - } -}); - Cypress.Commands.add('naviagte', route => { cy.visit(route); cy.location().should((loc) => { diff --git a/package-lock.json b/package-lock.json index f19ba14..5c89a88 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1468,6 +1468,12 @@ } } }, + "cypress-localstorage-commands": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/cypress-localstorage-commands/-/cypress-localstorage-commands-1.2.1.tgz", + "integrity": "sha512-wWGElZS5fHAQDonZM8xtOA1tM+bTBUdwEMm6XrshLMKjq8Nxw4+Ysbl9/Yc+gZyv66EQe4hPNDLWANnp/zPkcA==", + "dev": true + }, "cypress-terminal-report": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/cypress-terminal-report/-/cypress-terminal-report-1.2.1.tgz", diff --git a/package.json b/package.json index 3792914..7f979d3 100644 --- a/package.json +++ b/package.json @@ -68,6 +68,7 @@ }, "devDependencies": { "cypress": "^4.5.0", + "cypress-localstorage-commands": "^1.2.1", "cypress-terminal-report": "^1.2.1" } } From a9f86520bb34d3ecf300a78c8905eb22e4172503 Mon Sep 17 00:00:00 2001 From: Jure Ursic Date: Tue, 14 Jul 2020 16:11:54 +0200 Subject: [PATCH 07/39] feature: Leave project test flow --- .gitlab-ci.yml | 1 + cypress/integration/leave-project.spec.js | 50 ++++++++++++++++++++++ cypress/integration/retire-project.spec.js | 2 +- 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 cypress/integration/leave-project.spec.js diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a660e45..a17e7c9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,6 +23,7 @@ build: stage: build before_script: - npm ci --cache .npm --prefer-offline --only=production + - npm i cypress-localstorage-commands script: - cp config.sample.json config.json - npm run build diff --git a/cypress/integration/leave-project.spec.js b/cypress/integration/leave-project.spec.js new file mode 100644 index 0000000..0ceef4c --- /dev/null +++ b/cypress/integration/leave-project.spec.js @@ -0,0 +1,50 @@ +/// +/* globals cy, expect */ + +context('Leave Project Browser Testing', () => { + let tableQuery = [ + 'solid-display.table-body', + 'solid-display:last-child', + 'hubl-admin-project-leave-button', + 'solid-delete' + ], + tableListQuery = [ + 'solid-display[nested-field="projects"]', + 'div >', + 'solid-display' + ]; + before(() => { + cy.clearLocalStorageSnapshot(); + cy.clearLocalStorage({ domain: null }); + cy.clearCookies({ domain: null }); + }); + beforeEach(() => cy.restoreLocalStorage()); + afterEach(() => cy.saveLocalStorage()); + it('should visit user login screend', () => cy.userLogin()); + describe('Project Leaving process', () => { + it('should login', () => cy.login()); + it('should visit the projects list screen', () => cy.naviagte('/admin/admin-projects')); + it('should click the last project leave button', () => { + cy.get(tableListQuery.join(' ')).its('length').as('projectsLength'); + cy.get(tableQuery.join(' ')).click(); + }); + it('should check', () => { + cy.get(tableListQuery.join(' ')).its('length').should(length => { + expect(length).to.eq(this.projectsLength - 1); + }); + }); + /*it('should click button to retire the project', () => { + cy.scrollTo('bottom'); + cy.get('solid-delete[data-label="Retirer"] button').click(); + }); + it('should stay on project edit screen', () => { + cy.get(menuQuery.join(' ')) + .invoke('attr', 'data-src') + .then(url => cy.encodeUrl(url).then(id => { + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/project/@' + id + '/project-information/project-edit'); + }); + })); + });*/ + }); +}); diff --git a/cypress/integration/retire-project.spec.js b/cypress/integration/retire-project.spec.js index e319d83..71d23b6 100644 --- a/cypress/integration/retire-project.spec.js +++ b/cypress/integration/retire-project.spec.js @@ -17,7 +17,7 @@ context('Retire Project Browser Testing', () => { it('should visit user login screend', () => cy.userLogin()); describe('Project Retirement process', () => { it('should login', () => cy.login()); - it('should visit the project creation screen', () => cy.naviagte('/admin/admin-projects')); + it('should visit the projects list screen', () => cy.naviagte('/admin/admin-projects')); it('should visit the last project edit screen', () => { cy.get(menuQuery.join(' ')) .invoke('attr', 'data-src') From c548add2360a1fe1c218b33871ad73583b82fa57 Mon Sep 17 00:00:00 2001 From: Jure Ursic Date: Thu, 16 Jul 2020 15:50:16 +0200 Subject: [PATCH 08/39] update: wrapping up and final adjustments to completed test flows --- cypress/README.md | 54 +++++++++ cypress/integration/create-channel.spec.js | 88 ++++++++++---- cypress/integration/create-job-offer.spec.js | 18 +-- cypress/integration/create-project.spec.js | 73 +++++++----- cypress/integration/create-user.spec.js | 20 +--- cypress/integration/delete-channel.spec.js | 55 +++++++++ cypress/integration/edit-channel.spec.js | 2 +- cypress/integration/edit-job-offer.spec.js | 6 +- cypress/integration/edit-project.spec.js | 2 +- cypress/integration/edit-user.spec.js | 68 +++++++++++ cypress/integration/leave-channel.spec.js | 37 ++++++ cypress/integration/leave-project.spec.js | 17 +-- cypress/integration/list-job-offers.spec.js | 79 ++++++++++++ cypress/integration/list-users.spec.js | 119 +++++++++++++++++++ cypress/integration/retire-channel.spec.js | 55 +++++++++ cypress/integration/retire-project.spec.js | 28 +++-- 16 files changed, 607 insertions(+), 114 deletions(-) create mode 100644 cypress/README.md create mode 100644 cypress/integration/delete-channel.spec.js create mode 100644 cypress/integration/edit-user.spec.js create mode 100644 cypress/integration/leave-channel.spec.js create mode 100644 cypress/integration/list-job-offers.spec.js create mode 100644 cypress/integration/list-users.spec.js create mode 100644 cypress/integration/retire-channel.spec.js diff --git a/cypress/README.md b/cypress/README.md new file mode 100644 index 0000000..3081ad7 --- /dev/null +++ b/cypress/README.md @@ -0,0 +1,54 @@ +## Users: +``` + - signin + - signup + - create + - listing + - edit + // TO-FIX: Uncomment workaround (blocked by: nested routing bug) +``` + +## Job Offers: +``` + - create + - edit + - listing + // TO-FIX: Search by title and description (blocked by: no search fields available) + - post + // TO-DO: Entire flow (blocked by: no published / unpublished flag) +``` + +## Channels: +``` + - create + - edit + - leave + - retire + - delete + - join + // TO-DO: Join other user created project (blocked by: can't create new user to create a channel) + - invite + // TO-DO +``` + +## Projects: +``` + - create + - edit + - leave + - retire + - delete + // TO-DO: Delete a project (blocked by: no option to delete a project) + - join + // TO-DO: Join other user created project (blocked by: can't create new user to create a project) + - invite + // TO-DO +``` + +## Breakdown: +``` +DONE: 15 +TO-FIX: 2 +BLOCKED: 4 +NOT DONE: 2 +``` diff --git a/cypress/integration/create-channel.spec.js b/cypress/integration/create-channel.spec.js index 7dda64b..54d2d8a 100644 --- a/cypress/integration/create-channel.spec.js +++ b/cypress/integration/create-channel.spec.js @@ -2,13 +2,7 @@ /* globals cy, expect */ context('Create Channel Browser Testing', () => { - let channelName = 'Test Channel ', - description = 'Test Description '; before(() => { - cy.randomNum().then(num => { - channelName += num; - description += num; - }); cy.clearLocalStorageSnapshot(); cy.clearLocalStorage({ domain: null }); cy.clearCookies({ domain: null }); @@ -16,28 +10,78 @@ context('Create Channel Browser Testing', () => { beforeEach(() => cy.restoreLocalStorage()); afterEach(() => cy.saveLocalStorage()); it('should visit user login screen', () => cy.userLogin()); - describe('Channel Creation process', () => { - it('should login', () => cy.login()); + it('should login', () => cy.login()); + 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 enter incorrect channel data', () => { - cy.get('#admin-circle-create input[name="name"]').type('!"#$%&'); - cy.get('#admin-circle-create input[name="name"]').should('have.value', '!"#$%&'); - cy.get('#admin-circle-create input[name="description"]').type(description); - cy.get('#admin-circle-create input[name="description"]').should('have.value', description); + it('should enter correct channel data', () => { + cy.randomNum().then(num => { + channelName += num; + description += num; + cy.get('#admin-circle-create input[name="name"]').clear().type(channelName); + cy.get('#admin-circle-create input[name="name"]').should('have.value', channelName); + cy.get('#admin-circle-create input[name="description"]').clear().type(description); + cy.get('#admin-circle-create input[name="description"]').should('have.value', description); + }); }); it('should click on create channel button', () => { cy.get('#admin-circle-create input[type="submit"]').click(); }); - it('should provide errors about incorrect channel data', () => { - // TO-DO: Check for error messages - cy.get('element') - .should('contain.text', 'Error message.'); - });*/ + it('should land on channels list screen', () => { + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/admin'); + }); + }); + it('should land newly created channel on channels list screen', () => { + cy.contains('solid-display-value[name="circle.name"]', channelName).should("exist"); + cy.fixture('admin.json').then(admin => { + cy.contains('solid-display-value[name="username"]', admin.username).should("exist"); + }); + }); + }); + 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 enter correct channel data', () => { - cy.get('#admin-circle-create input[name="name"]').clear().type(channelName); - cy.get('#admin-circle-create input[name="name"]').should('have.value', channelName); - cy.get('#admin-circle-create input[name="description"]').clear().type(description); - cy.get('#admin-circle-create input[name="description"]').should('have.value', description); + cy.randomNum().then(num => { + channelName += num; + description += num; + cy.get('#admin-circle-create input[name="name"]').clear().type(channelName); + cy.get('#admin-circle-create input[name="name"]').should('have.value', channelName); + cy.get('#admin-circle-create input[name="description"]').clear().type(description); + cy.get('#admin-circle-create input[name="description"]').should('have.value', description); + }); + }); + it('should click on create channel button', () => { + cy.get('#admin-circle-create input[type="submit"]').click(); + }); + it('should land on channels list screen', () => { + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/admin'); + }); + }); + it('should land newly created channel on channels list screen', () => { + cy.contains('solid-display-value[name="circle.name"]', channelName).should("exist"); + cy.fixture('admin.json').then(admin => { + cy.contains('solid-display-value[name="username"]', admin.username).should("exist"); + }); + }); + }); + 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 enter correct channel data', () => { + cy.randomNum().then(num => { + channelName += num; + description += num; + cy.get('#admin-circle-create input[name="name"]').clear().type(channelName); + cy.get('#admin-circle-create input[name="name"]').should('have.value', channelName); + cy.get('#admin-circle-create input[name="description"]').clear().type(description); + cy.get('#admin-circle-create input[name="description"]').should('have.value', description); + }); }); it('should click on create channel button', () => { cy.get('#admin-circle-create input[type="submit"]').click(); diff --git a/cypress/integration/create-job-offer.spec.js b/cypress/integration/create-job-offer.spec.js index b4d6d43..0940eaa 100644 --- a/cypress/integration/create-job-offer.spec.js +++ b/cypress/integration/create-job-offer.spec.js @@ -20,25 +20,9 @@ context('Create Job Offer Browser Testing', () => { beforeEach(() => cy.restoreLocalStorage()); afterEach(() => cy.saveLocalStorage()); it('should visit user login screen', () => cy.userLogin()); + it('should login', () => cy.login()); describe('Job Offer Creation process', () => { - it('should login', () => cy.login()); it('should visit the job offer creation screen', () => cy.naviagte('/job-offers/job-offers-create')); - /*it('should enter incorrect job offer data', () => { - cy.get('#job-offers-create input[name="closingDate"]').type('!"#$%&'); - cy.get('#job-offers-create input[name="closingDate"]').should('have.value', '!"#$%&'); - cy.get('#job-offers-create input[name="title"]').type('!"#$%&'); - cy.get('#job-offers-create input[name="title"]').should('have.value', '!"#$%&'); - cy.get('#job-offers-create textarea[name="description"]').type(description); - cy.get('#job-offers-create textarea[name="description"]').should('have.value', description); - }); - it('should click on create job offer button', () => { - cy.get('#job-offers-create input[type="submit"]').click(); - }); - it('should provide errors about incorrect job offer data', () => { - // TO-DO: Check for error messages - cy.get('element') - .should('contain.text', 'Error message.'); - });*/ 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 9322c21..ba198c7 100644 --- a/cypress/integration/create-project.spec.js +++ b/cypress/integration/create-project.spec.js @@ -2,15 +2,7 @@ /* globals cy, expect */ context('Create Project Browser Testing', () => { - let projectName = 'Test Project ', - customerName = 'Test Customer ', - description = 'Test Description '; before(() => { - cy.randomNum().then(num => { - projectName += num; - customerName += num; - description += num; - }); cy.clearLocalStorageSnapshot(); cy.clearLocalStorage({ domain: null }); cy.clearCookies({ domain: null }); @@ -18,32 +10,57 @@ context('Create Project Browser Testing', () => { beforeEach(() => cy.restoreLocalStorage()); afterEach(() => cy.saveLocalStorage()); it('should visit user login screen', () => cy.userLogin()); - describe('Project Creation process', () => { - it('should login', () => cy.login()); + it('should login', () => cy.login()); + describe('Project Creation process #1', () => { + 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 enter incorrect project data', () => { - cy.get('#admin-project-create input[name="customer.name"]').type('!"#$%&'); - cy.get('#admin-project-create input[name="customer.name"]').should('have.value', '!"#$%&'); - cy.get('#admin-project-create input[name="name"]').type('!"#$%&'); - cy.get('#admin-project-create input[name="name"]').should('have.value', '!"#$%&'); - cy.get('#admin-project-create textarea[name="description"]').type(description); - cy.get('#admin-project-create textarea[name="description"]').should('have.value', description); + it('should enter correct project data', () => { + cy.randomNum().then(num => { + projectName += num; + customerName += num; + description += num; + cy.get('#admin-project-create input[name="customer.name"]').clear().type(customerName); + cy.get('#admin-project-create input[name="customer.name"]').should('have.value', customerName); + cy.get('#admin-project-create input[name="name"]').clear().type(projectName); + cy.get('#admin-project-create input[name="name"]').should('have.value', projectName); + cy.get('#admin-project-create textarea[name="description"]').clear().type(description); + cy.get('#admin-project-create textarea[name="description"]').should('have.value', description); + }); }); it('should click on create project button', () => { cy.get('#admin-project-create input[type="submit"]').click(); }); - it('should provide errors about incorrect project data', () => { - // TO-DO: Check for error messages - cy.get('element') - .should('contain.text', 'Error message.'); - });*/ + it('should land on projects list screen', () => { + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/admin/admin-projects'); + }); + }); + it('should land newly created project on projects list screen', () => { + cy.contains('solid-display-value[name="project.name"]', projectName).should("exist"); + cy.fixture('admin.json').then(admin => { + cy.contains('solid-display-value[name="username"]', admin.username).should("exist"); + }); + }); + }); + describe('Project Creation process #2', () => { + 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 enter correct project data', () => { - cy.get('#admin-project-create input[name="customer.name"]').clear().type(customerName); - cy.get('#admin-project-create input[name="customer.name"]').should('have.value', customerName); - cy.get('#admin-project-create input[name="name"]').clear().type(projectName); - cy.get('#admin-project-create input[name="name"]').should('have.value', projectName); - cy.get('#admin-project-create textarea[name="description"]').clear().type(description); - cy.get('#admin-project-create textarea[name="description"]').should('have.value', description); + cy.randomNum().then(num => { + projectName += num; + customerName += num; + description += num; + cy.get('#admin-project-create input[name="customer.name"]').clear().type(customerName); + cy.get('#admin-project-create input[name="customer.name"]').should('have.value', customerName); + cy.get('#admin-project-create input[name="name"]').clear().type(projectName); + cy.get('#admin-project-create input[name="name"]').should('have.value', projectName); + cy.get('#admin-project-create textarea[name="description"]').clear().type(description); + cy.get('#admin-project-create textarea[name="description"]').should('have.value', description); + }); }); it('should click on create project button', () => { cy.get('#admin-project-create input[type="submit"]').click(); diff --git a/cypress/integration/create-user.spec.js b/cypress/integration/create-user.spec.js index 1abd7a1..f3fe42c 100644 --- a/cypress/integration/create-user.spec.js +++ b/cypress/integration/create-user.spec.js @@ -20,27 +20,9 @@ context('Create User Browser Testing', () => { beforeEach(() => cy.restoreLocalStorage()); afterEach(() => cy.saveLocalStorage()); it('should visit user login screen', () => cy.userLogin()); + it('should login', () => cy.login()); describe('User Creation process', () => { - it('should login', () => cy.login()); it('should visit the user creation screen', () => cy.naviagte('/admin/admin-users/admin-users-create')); - /*it('should enter incorrect user data', () => { - cy.get('#admin-users-create input[name="first_name"]').type(firstName); - cy.get('#admin-users-create input[name="first_name"]').should('have.value', firstName); - cy.get('#admin-users-create input[name="last_name"]').type(lastName); - cy.get('#admin-users-create input[name="last_name"]').should('have.value', lastName); - cy.get('#admin-users-create input[name="username"]').type('!"#$%&'); - cy.get('#admin-users-create input[name="username"]').should('have.value', '!"#$%&'); - cy.get('#admin-users-create input[name="email"]').type(email.split('.')[0]); - cy.get('#admin-users-create input[name="email"]').should('have.value', email.split('.')[0]); - }); - it('should click on create user button', () => { - cy.get('#admin-users-create input[type="submit"]').click(); - }); - it('should provide errors about incorrect user data', () => { - // TO-DO: Check for error messages - cy.get('element') - .should('contain.text', 'Error message.'); - });*/ 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 new file mode 100644 index 0000000..e022546 --- /dev/null +++ b/cypress/integration/delete-channel.spec.js @@ -0,0 +1,55 @@ +/// +/* globals cy, expect */ + +context('Delete Channel Browser Testing', () => { + let menuQuery = [ + 'solid-display.circle-tab', + 'solid-display:last-child', + 'solid-display[order-by="name"]' + ], + menuCountQuery = [ + 'solid-display.circle-tab', + 'solid-display', + 'solid-display[order-by="name"]' + ]; + before(() => { + cy.clearLocalStorageSnapshot(); + cy.clearLocalStorage({ domain: null }); + cy.clearCookies({ domain: null }); + }); + beforeEach(() => cy.restoreLocalStorage()); + afterEach(() => cy.saveLocalStorage()); + it('should visit user login screend', () => cy.userLogin()); + 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 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'); + })); + }); + it('should count the number of joined channels', () => { + cy.get(menuCountQuery.join(' ')).its('length').then(length => channelsLength = length); + }); + it('should click button to retire the channel', () => { + cy.get('#circle-profile solid-delete[data-label="Supprimer le canal"] button').click(); + }); + it('should stay on channel edit screen', () => { + cy.get(menuQuery.join(' ')) + .invoke('attr', 'data-src') + .then(url => cy.encodeUrl(url).then(id => { + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/circle/@' + id + '/circle-information'); + }); + })); + }); + it('should check if chennel was retired', () => { + cy.get(menuCountQuery.join(' ')).its('length').should(length => { + expect(length).to.eq(channelsLength - 1); + }); + }); + }); +}); diff --git a/cypress/integration/edit-channel.spec.js b/cypress/integration/edit-channel.spec.js index ea53551..f0baa3b 100644 --- a/cypress/integration/edit-channel.spec.js +++ b/cypress/integration/edit-channel.spec.js @@ -21,8 +21,8 @@ context('Edit Channel Browser Testing', () => { beforeEach(() => cy.restoreLocalStorage()); afterEach(() => cy.saveLocalStorage()); it('should visit user login screen', () => cy.userLogin()); + it('should login', () => cy.login()); describe('Channel Edition process', () => { - it('should login', () => cy.login()); it('should visit the channel list screen', () => cy.naviagte('/admin')); it('should visit the last channel edit screen', () => { cy.get(menuQuery.join(' ')) diff --git a/cypress/integration/edit-job-offer.spec.js b/cypress/integration/edit-job-offer.spec.js index 53d6dca..16c0f99 100644 --- a/cypress/integration/edit-job-offer.spec.js +++ b/cypress/integration/edit-job-offer.spec.js @@ -24,10 +24,10 @@ context('Edit Job Offer Browser Testing', () => { beforeEach(() => cy.restoreLocalStorage()); afterEach(() => cy.saveLocalStorage()); it('should visit user login screen', () => cy.userLogin()); + it('should login', () => cy.login()); describe('Job Offer Edition process', () => { - it('should login', () => cy.login()); it('should visit the job offers list screen', () => cy.naviagte('/job-offers')); - it('should visit the last project edit screen', () => { + it('should visit the last job offer edit screen', () => { cy.get(menuQuery.join(' ')) .invoke('attr', 'data-src') .then(url => cy.encodeUrl(url).then(id => { @@ -50,7 +50,7 @@ context('Edit Job Offer Browser Testing', () => { expect(loc.pathname).to.eq('/job-offers'); }); }); - it('should show edited project data on project information screen', () => { + it('should show edited job offer data on job offer information screen', () => { cy.contains('solid-display-value[name="title"]', jobTitle).should("exist"); cy.contains('solid-display-value[name="description"]', description).should("exist"); }); diff --git a/cypress/integration/edit-project.spec.js b/cypress/integration/edit-project.spec.js index 42e1386..766c252 100644 --- a/cypress/integration/edit-project.spec.js +++ b/cypress/integration/edit-project.spec.js @@ -23,8 +23,8 @@ context('Edit Project Browser Testing', () => { beforeEach(() => cy.restoreLocalStorage()); afterEach(() => cy.saveLocalStorage()); it('should visit user login screen', () => cy.userLogin()); + it('should login', () => cy.login()); describe('Project Edition process', () => { - it('should login', () => cy.login()); it('should visit the project list screen', () => cy.naviagte('/admin/admin-projects')); it('should visit the last project edit screen', () => { cy.get(menuQuery.join(' ')) diff --git a/cypress/integration/edit-user.spec.js b/cypress/integration/edit-user.spec.js new file mode 100644 index 0000000..ac29f41 --- /dev/null +++ b/cypress/integration/edit-user.spec.js @@ -0,0 +1,68 @@ +/// +/* globals cy, expect */ + +context('Edit User Browser Testing', () => { + let userFirstName = 'Edited User First Name ', + userLastName = 'Edited User Last Name ', + jobDescription = 'Edited Job Description ', + city = 'Edited City ', + phone = '+1234', + website = 'https://test.site/'; + before(() => { + cy.randomNum().then(num => { + userFirstName += num; + userLastName += num; + jobDescription += num; + city += num; + phone += num; + website += num; + }); + cy.clearLocalStorageSnapshot(); + cy.clearLocalStorage({ domain: null }); + cy.clearCookies({ domain: null }); + }); + beforeEach(() => cy.restoreLocalStorage()); + afterEach(() => cy.saveLocalStorage()); + 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')); + /// 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(); + }); + /// End workaround + it('should enter new user data', () => { + cy.get('#solid-profile-edit-profile input[name="first_name"]').clear().type(userFirstName); + cy.get('#solid-profile-edit-profile input[name="first_name"]').should('have.value', userFirstName); + cy.get('#solid-profile-edit-profile input[name="last_name"]').clear().type(userLastName); + cy.get('#solid-profile-edit-profile input[name="last_name"]').should('have.value', userLastName); + cy.get('#solid-profile-edit-profile textarea[name="profile.job"]').clear().type(jobDescription); + cy.get('#solid-profile-edit-profile textarea[name="profile.job"]').should('have.value', jobDescription); + cy.get('#solid-profile-edit-profile input[name="profile.city"]').clear().type(city); + cy.get('#solid-profile-edit-profile input[name="profile.city"]').should('have.value', city); + cy.get('#solid-profile-edit-profile input[name="profile.phone"]').clear().type(phone); + cy.get('#solid-profile-edit-profile input[name="profile.phone"]').should('have.value', phone); + cy.get('#solid-profile-edit-profile input[name="profile.website"]').clear().type(website); + cy.get('#solid-profile-edit-profile input[name="profile.website"]').should('have.value', website); + }); + it('should click button to save the user', () => { + cy.get('#solid-profile-edit-profile input[value="ENREGISTRER"]').click(); + }); + it('should land on user information screen', () => { + cy.location().should(location => { + /// Workaround - Routing bug - route pathname won't be /profile as it should + expect(location.pathname).to.eq('/'); + // expect(location.pathname).to.eq('/profile'); + /// End workaround + }); + }); + it('should show edited user data on user information screen', () => { + cy.contains('solid-display-value[name="name"]', userFirstName + ' ' + userLastName).should("exist"); + cy.contains('solid-display-value[name="profile.job"]', jobDescription).should("exist"); + cy.contains('solid-display-value[name="profile.city"]', city).should("exist"); + cy.contains('solid-display-tel[name="profile.phone"] a', phone).should("exist"); + cy.contains('profile-website[name="profile.website"] a', website).should("exist"); + }); + }); +}); diff --git a/cypress/integration/leave-channel.spec.js b/cypress/integration/leave-channel.spec.js new file mode 100644 index 0000000..638eb58 --- /dev/null +++ b/cypress/integration/leave-channel.spec.js @@ -0,0 +1,37 @@ +/// +/* globals cy, expect */ + +context('Leave Channel Browser Testing', () => { + let tableQuery = [ + 'solid-display.table-body', + 'solid-display:last-child', + 'hubl-admin-circle-leave-button', + 'solid-delete' + ], + tableListQuery = [ + 'solid-display[nested-field="circles"]', + 'div >', + 'solid-display' + ]; + before(() => { + cy.clearLocalStorageSnapshot(); + cy.clearLocalStorage({ domain: null }); + cy.clearCookies({ domain: null }); + }); + beforeEach(() => cy.restoreLocalStorage()); + afterEach(() => cy.saveLocalStorage()); + 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 click the last channel leave button', () => { + cy.get(tableListQuery.join(' ')).its('length').as('channelsLength'); + cy.get(tableQuery.join(' ')).click(); + }); + it('should check if chennel was left', () => { + cy.get(tableListQuery.join(' ')).its('length').should(length => { + expect(length).to.eq(this.channelsLength - 1); + }); + }); + }); +}); diff --git a/cypress/integration/leave-project.spec.js b/cypress/integration/leave-project.spec.js index 0ceef4c..8c623fe 100644 --- a/cypress/integration/leave-project.spec.js +++ b/cypress/integration/leave-project.spec.js @@ -21,30 +21,17 @@ context('Leave Project Browser Testing', () => { beforeEach(() => cy.restoreLocalStorage()); afterEach(() => cy.saveLocalStorage()); it('should visit user login screend', () => cy.userLogin()); + it('should login', () => cy.login()); describe('Project Leaving process', () => { - it('should login', () => cy.login()); it('should visit the projects list screen', () => cy.naviagte('/admin/admin-projects')); it('should click the last project leave button', () => { cy.get(tableListQuery.join(' ')).its('length').as('projectsLength'); cy.get(tableQuery.join(' ')).click(); }); - it('should check', () => { + it('should check if project was left', () => { cy.get(tableListQuery.join(' ')).its('length').should(length => { expect(length).to.eq(this.projectsLength - 1); }); }); - /*it('should click button to retire the project', () => { - cy.scrollTo('bottom'); - cy.get('solid-delete[data-label="Retirer"] button').click(); - }); - it('should stay on project edit screen', () => { - cy.get(menuQuery.join(' ')) - .invoke('attr', 'data-src') - .then(url => cy.encodeUrl(url).then(id => { - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/project/@' + id + '/project-information/project-edit'); - }); - })); - });*/ }); }); diff --git a/cypress/integration/list-job-offers.spec.js b/cypress/integration/list-job-offers.spec.js new file mode 100644 index 0000000..badf05d --- /dev/null +++ b/cypress/integration/list-job-offers.spec.js @@ -0,0 +1,79 @@ +/// +/* globals cy, expect */ + +context('List Job Offers Browser Testing', () => { + let listQuery = 'solid-display.job-board__list', + filtersQuery = [ + listQuery, + 'solid-form', + 'input' + ], + listingCountQuery = [ + listQuery, + 'solid-display' + ], + firstListingQuery = [ + listQuery, + 'solid-display:first-child', + 'solid-display-value' + ]; + before(() => { + cy.clearLocalStorageSnapshot(); + cy.clearLocalStorage({ domain: null }); + cy.clearCookies({ domain: null }); + }); + beforeEach(() => cy.restoreLocalStorage()); + afterEach(() => cy.saveLocalStorage()); + it('should visit user login screen', () => cy.userLogin()); + it('should login', () => cy.login()); + describe('Job Offer Listing process', () => { + let listingTitle, + listingDesccription, + listingCount; + it('should visit the job offers listing screen', () => cy.naviagte('/job-offers')); + it('should get the listing count', () => { + cy.get(listingCountQuery.join(' ')).its('length').then(length => listingCount = length); + }); + it('should get the first job offer listing data', () => { + cy.get(firstListingQuery.join(' ') + '[name="title"]').invoke('text').then(text => listingTitle = text); + cy.get(firstListingQuery.join(' ') + '[name="description"]').invoke('text').then(text => listingDesccription = text); + }); + // TO-DO: Search by title and description + /*it('should filter the listing by first name', () => { + cy.get(filtersQuery.join(' ') + '[name="title"]').clear().type(listingTitle); + cy.get(filtersQuery.join(' ') + '[name="title"]').should('have.value', listingTitle); + }); + it('should get filtered listing count', () => { + cy.get(listingCountQuery.join(' ')).its('length').then(length => { + expect(length).to.eq(1); + }); + }); + it('should clear the first name filter', () => { + cy.get(filtersQuery.join(' ') + '[name="title"]').clear(); + cy.get(filtersQuery.join(' ') + '[name="title"]').should('have.value', ''); + }); + it('should get previous listing count', () => { + cy.get(listingCountQuery.join(' ')).its('length').then(length => { + expect(length).to.eq(listingCount); + }); + }); + it('should filter the listing by first name', () => { + cy.get(filtersQuery.join(' ') + '[name="description"]').clear().type(listingDesccription); + cy.get(filtersQuery.join(' ') + '[name="description"]').should('have.value', listingDesccription); + }); + it('should get filtered listing count', () => { + cy.get(listingCountQuery.join(' ')).its('length').then(length => { + expect(length).to.eq(1); + }); + }); + it('should clear the first name filter', () => { + cy.get(filtersQuery.join(' ') + '[name="description"]').clear(); + cy.get(filtersQuery.join(' ') + '[name="description"]').should('have.value', ''); + }); + it('should get previous listing count', () => { + cy.get(listingCountQuery.join(' ')).its('length').then(length => { + expect(length).to.eq(listingCount); + }); + });*/ + }); +}); diff --git a/cypress/integration/list-users.spec.js b/cypress/integration/list-users.spec.js new file mode 100644 index 0000000..9db3595 --- /dev/null +++ b/cypress/integration/list-users.spec.js @@ -0,0 +1,119 @@ +/// +/* globals cy, expect */ + +context('List Users Browser Testing', () => { + let listQuery = 'solid-display#members-list__content', + filtersQuery = [ + listQuery, + 'solid-form', + 'input' + ], + listingCountQuery = [ + listQuery, + 'div:first-child', + 'span' + ], + firstListingQuery = [ + listQuery, + 'solid-display:first-child', + 'solid-display-value' + ]; + before(() => { + cy.clearLocalStorageSnapshot(); + cy.clearLocalStorage({ domain: null }); + cy.clearCookies({ domain: null }); + }); + beforeEach(() => cy.restoreLocalStorage()); + afterEach(() => cy.saveLocalStorage()); + it('should visit user login screen', () => cy.userLogin()); + it('should login', () => cy.login()); + describe('User Listing process', () => { + let listingFirstName, + listingLastName, + listingJob, + listingCity, + listingCount; + it('should visit the users listing screen', () => cy.naviagte('/members')); + it('should get the listing count', () => { + cy.get(listingCountQuery.join(' ')).invoke('text').then(text => listingCount = text); + }); + it('should get the first user listing data', () => { + cy.get(firstListingQuery.join(' ') + '[name="first_name"]').invoke('text').then(text => listingFirstName = text); + cy.get(firstListingQuery.join(' ') + '[name="last_name"]').invoke('text').then(text => listingLastName = text); + cy.get(firstListingQuery.join(' ') + '[name="profile.job"]').invoke('text').then(text => listingJob = text); + cy.get(firstListingQuery.join(' ') + '[name="profile.city"]').invoke('text').then(text => listingCity = text); + }); + it('should filter the listing by first name', () => { + cy.get(filtersQuery.join(' ') + '[name="name"]').clear().type(listingFirstName); + cy.get(filtersQuery.join(' ') + '[name="name"]').should('have.value', listingFirstName); + }); + it('should get filtered listing count', () => { + cy.get(listingCountQuery.join(' ')).invoke('text').then(text => { + expect(text).to.eq('1 membres'); + }); + }); + it('should clear the first name filter', () => { + cy.get(filtersQuery.join(' ') + '[name="name"]').clear(); + cy.get(filtersQuery.join(' ') + '[name="name"]').should('have.value', ''); + }); + it('should get previous listing count', () => { + cy.get(listingCountQuery.join(' ')).invoke('text').then(text => { + expect(text).to.eq(listingCount); + }); + }); + it('should filter the listing by last name', () => { + cy.get(filtersQuery.join(' ') + '[name="name"]').clear().type(listingLastName); + cy.get(filtersQuery.join(' ') + '[name="name"]').should('have.value', listingLastName); + }); + it('should get filtered listing count', () => { + cy.get(listingCountQuery.join(' ')).invoke('text').then(text => { + expect(text).to.eq('1 membres'); + }); + }); + it('should clear the last name filter', () => { + cy.get(filtersQuery.join(' ') + '[name="name"]').clear(); + cy.get(filtersQuery.join(' ') + '[name="name"]').should('have.value', ''); + }); + it('should get previous listing count', () => { + cy.get(listingCountQuery.join(' ')).invoke('text').then(text => { + expect(text).to.eq(listingCount); + }); + }); + it('should filter the listing by job description', () => { + cy.get(filtersQuery.join(' ') + '[name="member-job"]').clear().type(listingJob); + cy.get(filtersQuery.join(' ') + '[name="member-job"]').should('have.value', listingJob); + }); + it('should get filtered listing count', () => { + cy.get(listingCountQuery.join(' ')).invoke('text').then(text => { + expect(text).to.eq('1 membres'); + }); + }); + it('should clear the job description filter', () => { + cy.get(filtersQuery.join(' ') + '[name="member-job"]').clear(); + cy.get(filtersQuery.join(' ') + '[name="member-job"]').should('have.value', ''); + }); + it('should get previous listing count', () => { + cy.get(listingCountQuery.join(' ')).invoke('text').then(text => { + expect(text).to.eq(listingCount); + }); + }); + it('should filter the listing by city', () => { + cy.get(filtersQuery.join(' ') + '[name="member-city"]').clear().type(listingCity); + cy.get(filtersQuery.join(' ') + '[name="member-city"]').should('have.value', listingCity); + }); + it('should get filtered listing count', () => { + cy.get(listingCountQuery.join(' ')).invoke('text').then(text => { + expect(text).to.eq('1 membres'); + }); + }); + it('should clear the city filter', () => { + cy.get(filtersQuery.join(' ') + '[name="member-city"]').clear(); + cy.get(filtersQuery.join(' ') + '[name="member-city"]').should('have.value', ''); + }); + it('should get previous listing count', () => { + cy.get(listingCountQuery.join(' ')).invoke('text').then(text => { + expect(text).to.eq(listingCount); + }); + }); + }); +}); diff --git a/cypress/integration/retire-channel.spec.js b/cypress/integration/retire-channel.spec.js new file mode 100644 index 0000000..6f0a659 --- /dev/null +++ b/cypress/integration/retire-channel.spec.js @@ -0,0 +1,55 @@ +/// +/* globals cy, expect */ + +context('Retire Channel Browser Testing', () => { + let menuQuery = [ + 'solid-display.circle-tab', + 'solid-display:last-child', + 'solid-display[order-by="name"]' + ], + menuCountQuery = [ + 'solid-display.circle-tab', + 'solid-display', + 'solid-display[order-by="name"]' + ]; + before(() => { + cy.clearLocalStorageSnapshot(); + cy.clearLocalStorage({ domain: null }); + cy.clearCookies({ domain: null }); + }); + beforeEach(() => cy.restoreLocalStorage()); + afterEach(() => cy.saveLocalStorage()); + it('should visit user login screend', () => cy.userLogin()); + 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 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'); + })); + }); + it('should count the number of joined channels', () => { + cy.get(menuCountQuery.join(' ')).its('length').then(length => channelsLength = length); + }); + it('should click button to retire the channel', () => { + cy.get('solid-multiple[name="members"] solid-delete[data-label="Retirer"] button').click(); + }); + it('should stay on channel edit screen', () => { + cy.get(menuQuery.join(' ')) + .invoke('attr', 'data-src') + .then(url => cy.encodeUrl(url).then(id => { + cy.location().should((loc) => { + expect(loc.pathname).to.eq('/circle/@' + id + '/circle-information/circle-edit'); + }); + })); + }); + it('should check if chennel was retired', () => { + cy.get(menuCountQuery.join(' ')).its('length').should(length => { + expect(length).to.eq(channelsLength - 1); + }); + }); + }); +}); diff --git a/cypress/integration/retire-project.spec.js b/cypress/integration/retire-project.spec.js index 71d23b6..a660395 100644 --- a/cypress/integration/retire-project.spec.js +++ b/cypress/integration/retire-project.spec.js @@ -3,10 +3,15 @@ context('Retire Project Browser Testing', () => { let menuQuery = [ - 'solid-display.project-tab', - 'solid-display:last-child', - 'solid-display[order-by="customer.name"]' - ]; + 'solid-display.project-tab', + 'solid-display:last-child', + 'solid-display[order-by="customer.name"]' + ], + menuCountQuery = [ + 'solid-display.project-tab', + 'solid-display', + 'solid-display[order-by="customer.name"]' + ]; before(() => { cy.clearLocalStorageSnapshot(); cy.clearLocalStorage({ domain: null }); @@ -15,8 +20,9 @@ context('Retire Project Browser Testing', () => { beforeEach(() => cy.restoreLocalStorage()); afterEach(() => cy.saveLocalStorage()); it('should visit user login screend', () => cy.userLogin()); + it('should login', () => cy.login()); describe('Project Retirement process', () => { - it('should login', () => cy.login()); + let projectsLength; it('should visit the projects list screen', () => cy.naviagte('/admin/admin-projects')); it('should visit the last project edit screen', () => { cy.get(menuQuery.join(' ')) @@ -25,9 +31,11 @@ context('Retire Project Browser Testing', () => { cy.naviagte('/project/@' + id + '/project-information/project-edit'); })); }); + it('should count the number of joined projects', () => { + cy.get(menuCountQuery.join(' ')).its('length').then(length => projectsLength = length); + }); it('should click button to retire the project', () => { - cy.scrollTo('bottom'); - cy.get('solid-delete[data-label="Retirer"] button').click(); + cy.get('solid-multiple[name="members"] solid-delete[data-label="Retirer"] button').click(); }); it('should stay on project edit screen', () => { cy.get(menuQuery.join(' ')) @@ -38,6 +46,10 @@ context('Retire Project Browser Testing', () => { }); })); }); - // TO-DO: clearify what needs to happen after and do the checks + it('should check if project was retired', () => { + cy.get(menuCountQuery.join(' ')).its('length').should(length => { + expect(length).to.eq(projectsLength - 1); + }); + }); }); }); From 66b8b57f146d3f547863430c73bc84c536c3b38d Mon Sep 17 00:00:00 2001 From: Jure Ursic Date: Thu, 16 Jul 2020 16:07:25 +0200 Subject: [PATCH 09/39] fix: install cypress-localstorage-commands in the right place --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a17e7c9..eca06b2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,7 +23,6 @@ build: stage: build before_script: - npm ci --cache .npm --prefer-offline --only=production - - npm i cypress-localstorage-commands script: - cp config.sample.json config.json - npm run build @@ -45,6 +44,7 @@ test:e2e: before_script: # install missing dependencies - npm install -g sirv-cli + - npm install cypress-localstorage-commands # making sure the process is orphan - sirv dist --port 3000 > /dev/null 2>&1 & script: From ee29fa3e7c952fa6f687c9ac9d011380f03eaa73 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Mon, 14 Sep 2020 15:41:10 +0200 Subject: [PATCH 10/39] minor: core@beta --- src/components/hubl-reactivity.js | 6 +- src/components/hubl-search-users.js | 2 +- src/components/hubl-status.js | 4 +- src/dependencies.pug | 22 +++--- src/page-user-profile.pug | 71 ------------------- src/styles/base/form.scss | 24 +++---- src/styles/components/comment.scss | 2 +- src/templates/hubl-circle-team.pug | 20 ------ src/templates/hubl-project-team.pug | 22 ------ .../admin/page-admin-projects-create.pug | 2 +- src/views/circle/page-circle-edit.pug | 59 ++++++--------- src/views/circle/page-circle-profile.pug | 22 ++++-- src/views/job-offer/page-job-offer-create.pug | 5 +- src/views/job-offer/page-job-offer-edit.pug | 5 +- src/views/project/page-project-edit.pug | 29 ++++++-- src/views/project/page-project-profile.pug | 22 ++++-- 16 files changed, 116 insertions(+), 201 deletions(-) delete mode 100644 src/page-user-profile.pug delete mode 100644 src/templates/hubl-circle-team.pug delete mode 100644 src/templates/hubl-project-team.pug diff --git a/src/components/hubl-reactivity.js b/src/components/hubl-reactivity.js index dce2a6c..261ef6e 100644 --- a/src/components/hubl-reactivity.js +++ b/src/components/hubl-reactivity.js @@ -1,6 +1,6 @@ -import { store } from 'https://unpkg.com/@startinblox/core@0.10'; -import { Sib } from "https://unpkg.com/@startinblox/core@0.10/dist/libs/Sib.js"; -import { StoreMixin } from "https://unpkg.com/@startinblox/core@0.10/dist/mixins/storeMixin.js"; +import { store } from 'https://unpkg.com/@startinblox/core@beta'; +import { Sib } from "https://unpkg.com/@startinblox/core@beta/dist/libs/Sib.js"; +import { StoreMixin } from "https://unpkg.com/@startinblox/core@beta/dist/mixins/storeMixin.js"; export const HublReactivity = { name: 'hubl-reactivity', diff --git a/src/components/hubl-search-users.js b/src/components/hubl-search-users.js index c65e58e..fafae32 100644 --- a/src/components/hubl-search-users.js +++ b/src/components/hubl-search-users.js @@ -1,4 +1,4 @@ -import { widgetFactory } from 'https://unpkg.com/@startinblox/core@0.10/dist/widgets/widget-factory.js'; +import { widgetFactory } from 'https://unpkg.com/@startinblox/core@beta/dist/widgets/widget-factory.js'; const HublSearchUsers = widgetFactory( 'hubl-search-users', diff --git a/src/components/hubl-status.js b/src/components/hubl-status.js index 7a94718..c9acf4b 100644 --- a/src/components/hubl-status.js +++ b/src/components/hubl-status.js @@ -1,5 +1,5 @@ -import { widgetFactory } from 'https://unpkg.com/@startinblox/core@0.10/dist/widgets/widget-factory.js'; -import { importCSS } from 'https://unpkg.com/@startinblox/core@0.10/dist/libs/helpers.js'; +import { widgetFactory } from 'https://unpkg.com/@startinblox/core@beta/dist/widgets/widget-factory.js'; +import { importCSS } from 'https://unpkg.com/@startinblox/core@beta/dist/libs/helpers.js'; import SlimSelect from 'https://dev.jspm.io/slim-select@1.23'; const HublStatus = widgetFactory( diff --git a/src/dependencies.pug b/src/dependencies.pug index a688ab5..ebe9ad9 100644 --- a/src/dependencies.pug +++ b/src/dependencies.pug @@ -2,36 +2,36 @@ script(type="module" src="/components/hubl-search-users.js" defer) script(type="module" src="/components/hubl-status.js" defer) script(type="module" src="/components/hubl-reactivity.js" defer) -script(type="module" src="https://unpkg.com/@startinblox/core@0.10" defer) +script(type="module" src="https://unpkg.com/@startinblox/core@beta" defer) //- script(type="module" src="/lib/sib-core/dist/index.js" defer) -script(type="module" src="https://unpkg.com/@startinblox/oidc@0.9" defer) -//- script(type="module" src="/lib/sib-oidc/index.js" defer) +script(type="module" src="https://unpkg.com/@startinblox/oidc@beta" defer) +//- script(type="module" src="/lib/sib-auth/index.js" defer) -script(type="module" src="https://unpkg.com/@startinblox/router@0.8" defer) - //- script(type="module" src="/lib/solid-router/src/index.js" defer) +script(type="module" src="https://unpkg.com/@startinblox/router@beta" defer) +//- script(type="module" src="/lib/sib-router/src/index.js" defer) -script(type="module" src="https://unpkg.com/@startinblox/component-notifications@0.6.2" defer) - //- script(type="module" src="/lib/sib-notifications/index.js" defer) +//- script(type="module" src="https://unpkg.com/@startinblox/component-notifications@0.6.2" defer) +//- script(type="module" src="/lib/sib-notifications/index.js" defer) if endpoints.events || (endpoints.get && endpoints.get.events) script(type="module" src="https://unpkg.com/@startinblox/component-event@0.1" defer) //- script(type="module" src="/lib/sib-event/sib-event.js" defer) if endpoints.joboffers || (endpoints.get && endpoints.get.joboffers) - script(type="module" src="https://unpkg.com/@startinblox/component-job-board@0.6" defer) + script(type="module" src="https://unpkg.com/@startinblox/component-job-board@beta" defer) //- script(type="module" src="/lib/solid-job-board/dist/index.js" defer) if (endpoints.uploads || (endpoints.get && endpoints.get.uploads)) && (endpoints.skills || (endpoints.get && endpoints.get.skills)) && (endpoints.users || (endpoints.get && endpoints.get.users)) - script(type="module" src="https://unpkg.com/@startinblox/component-directory@0.7" defer) + script(type="module" src="https://unpkg.com/@startinblox/component-directory@beta" defer) //- script(type="module" src="/lib/solid-directory/dist/index.js" defer) if endpoints.dashboards || (endpoints.get && endpoints.get.dashboards) - script(type="module" src="https://unpkg.com/@startinblox/component-dashboard@0.3" defer) + script(type="module" src="https://unpkg.com/@startinblox/component-dashboard@beta" defer) //- script(type="module" src="/lib/solid-dashboard/dist/index.js" defer) if endpoints.users || (endpoints.get && endpoints.get.users) - script(type="module" src="https://unpkg.com/@startinblox/component-chat@0.8" defer) + //- script(type="module" src="https://unpkg.com/@startinblox/component-chat@0.8" defer) //- script(type="module" src="/lib/solid-xmpp-chat/dist/index.js" defer) script(src="/scripts/index.js" defer) diff --git a/src/page-user-profile.pug b/src/page-user-profile.pug deleted file mode 100644 index aee271e..0000000 --- a/src/page-user-profile.pug +++ /dev/null @@ -1,71 +0,0 @@ -include templates/hubl-groups.pug - -.content-box.with-form.user-profile__container - - .section.user-bio - - solid-display.avatar-display( - bind-user='' - fields='account.picture' - label-account.picture='' - widget-account.picture='solid-display-img' - ) - - solid-display.name-diplay( - bind-user='' - fields='user-name-groups(name, groups), username' - - class-name='name' - - label-groups='' - multiple-groups='' - widget-groups='hubl-groups-name' - - class-username='username' - ) - - solid-form.info-form( - bind-user='' - fields='profile.bio, inline-1(profile.city, email), inline-2(profile.phone, profile.website), inline-3(profile.available), account.picture, instruction' - - class-profile.bio='form-label is-light' - label-profile.bio='short description' - - class-profile.city='form-label is-light' - label-profile.city='your cell' - - class-email='form-label is-light' - - class-profile.phone='form-label is-light' - label-profile.phone='phone' - - class-profile.website='form-label is-light' - label-profile.website='your website' - - class-profile.available='form-label is-light' - label-profile.available='your availability' - - class-account.picture='form-label is-light' - label-account.picture='your picture' - - widget-instruction='hubl-instruction' - ) - - .section.user-skills - - solid-form( - bind-user='' - range-skills=`${endpoints.skills || endpoints.get.skills}` - fields='skills' - - class-skills='form-label is-dark' - label-skills='Your main skills (4 max.):' - multiple-skills='solid-multiple-select' - widget-skills='solid-form-auto-completion' - ) - - - solid-widget(name='hubl-instruction') - template - span Show us your most beautiful smile - p Pictures help us to know ourselves and also to recognize ourselves, so don't be afraid to show your pretty face and avoid strange avatars. diff --git a/src/styles/base/form.scss b/src/styles/base/form.scss index 9234516..c241057 100644 --- a/src/styles/base/form.scss +++ b/src/styles/base/form.scss @@ -41,16 +41,14 @@ .form-label { /*flex: 1 1 auto;*/ - label { - display: flex; - flex-direction: column; /* To align label and input vertically */ - font-weight: 600; - margin-bottom: 0.8rem; - margin-top: 1.8rem; - text-transform: uppercase; - } + display: flex; + flex-direction: column; /* To align label and input vertically */ + font-weight: 600; + margin-bottom: 0.8rem; + margin-top: 1.8rem; + text-transform: uppercase; - &.is-light label { + &.is-light { color: var(--color-label-light); } } @@ -130,7 +128,7 @@ textarea { /* WIDGETS SIB (let in .content-box to override default styles) */ -solid-form-auto-completion, +solid-form-dropdown-autocompletion-label, hubl-status { .ss-main { @@ -288,13 +286,13 @@ solid-form-file { } } -/*solid-multiple-select { +/*solid-form-multipleselect { &.select-skills .ss-values .ss-disabled::before { content: "Select skills"; } - solid-form-auto-completion > label { + solid-form-dropdown-autocompletion-label > label { display: flex; flex-direction: column; @@ -378,7 +376,7 @@ hubl-member-form { margin-bottom: 1rem; } - solid-form-auto-completion { + solid-form-dropdown-autocompletion-label { float: left; } diff --git a/src/styles/components/comment.scss b/src/styles/components/comment.scss index 0a4dc94..8efbc01 100644 --- a/src/styles/components/comment.scss +++ b/src/styles/components/comment.scss @@ -74,7 +74,7 @@ solid-ac-checker { border-top: 1px solid $color-210-17-91; - solid-form-textarea { + solid-form-textarea-label { >label div { color: $color-210-5-56; diff --git a/src/templates/hubl-circle-team.pug b/src/templates/hubl-circle-team.pug deleted file mode 100644 index 2aff831..0000000 --- a/src/templates/hubl-circle-team.pug +++ /dev/null @@ -1,20 +0,0 @@ -include hubl-user-avatar.pug - -solid-widget(name='hubl-circle-team-template') - template - solid-display.user-thumb.is-spaced( - data-src='${await value.user}' - fields='account.picture, sup(name, isadmin), sub(profile.city)' - value-isadmin='${await value.is_admin}' - - class-account.picture='avatar user-thumb__picture' - class-name='user-thumb__name' - class-isadmin='user-thumb__admin' - class-profile.city='user-thumb__city' - - widget-account.picture='hubl-user-avatar' - widget-isadmin='hubl-circle-user-admin' - ) - -solid-widget(name='hubl-circle-user-admin') - template ${(await value) != "false" ? "Administrateur" : ""} diff --git a/src/templates/hubl-project-team.pug b/src/templates/hubl-project-team.pug deleted file mode 100644 index f8334c7..0000000 --- a/src/templates/hubl-project-team.pug +++ /dev/null @@ -1,22 +0,0 @@ -include hubl-user-avatar.pug - -solid-widget(name='hubl-project-team') - template - solid-display.user-thumb.is-spaced( - data-src='${await value}' - fields='user.account.picture, sup(user.name, isadmin), sub(user.profile.city, name)' - value-isadmin='${await value.is_admin}' - - class-user.account.picture='avatar user-thumb__picture' - - class-user.name='user-thumb__name' - class-isadmin='user-thumb__admin' - class-user.profile.city='user-thumb__city' - class-name='user-thumb__lead' - - widget-user.account.picture='hubl-user-avatar' - widget-isadmin='hubl-project-user-admin' - ) - -solid-widget(name='hubl-project-user-admin') - template ${(await value) == "false" ? "" : "Administrateur"} diff --git a/src/views/admin/page-admin-projects-create.pug b/src/views/admin/page-admin-projects-create.pug index 1bec5c3..aba7209 100644 --- a/src/views/admin/page-admin-projects-create.pug +++ b/src/views/admin/page-admin-projects-create.pug @@ -40,7 +40,7 @@ div.content-box__info.flex label-captain='Capitaine du projet*' range-captain=`${endpoints.users || endpoints.get.users}` class-captain='form-label is-light is-half-width' - widget-captain='solid-form-auto-completion' + widget-captain='solid-form-dropdown-autocompletion-label' class='input-text-like' diff --git a/src/views/circle/page-circle-edit.pug b/src/views/circle/page-circle-edit.pug index 41e4903..800f74b 100644 --- a/src/views/circle/page-circle-edit.pug +++ b/src/views/circle/page-circle-edit.pug @@ -5,42 +5,15 @@ div.content-box__info solid-widget(name='hubl-user-groups') template ${await value.name} - solid-widget(name='hubl-team-template-edit') + solid-widget(name="circle-edit-members-delete") template - solid-display.user-thumb.is-spaced( - class='w280 cell border cell-with-id-card user-thumb' - data-src='${await value.user}' - fields='account.picture, sup(name, groups), sub(profile.city)' - - class-account.picture='user-thumb__picture avatar' - class-name='user-thumb__name' - class-groups='user-thumb__groups' - class-profile.city='user-thumb__city' - - widget-account.picture='hubl-user-avatar' - - multiple-groups='' - widget-groups='hubl-user-groups' - ) - - solid-ac-checker( - class='w162 cell border' - permission="acl:Delete" - data-src="${value['@id']}" - ) + solid-ac-checker(permission="acl:Delete" data-src="${src}") solid-delete( class='button text-bold text-uppercase reversed button-secondary bordered with-icon icon-close' - data-src="${value['@id']}" + data-src="${src}" data-label='Retirer' ) - //- Only to show the table grid - solid-ac-checker( - class='w162 cell border' - no-permission="acl:Delete" - data-src="${value['@id']}" - ) - solid-link(class="backlink right", bind-resources, next='circle-profile') Retour solid-ac-checker(permission='acl:Write', bind-resources) @@ -70,7 +43,7 @@ div.content-box__info class-description='form-label is-light is-full-width input-text-like' class-status='form-label is-light is-full-width member-select color' - widget-owner='solid-form-auto-completion' + widget-owner='solid-form-dropdown-autocompletion-label' partial='' @@ -89,7 +62,7 @@ div.content-box__info class-user='team form-label is-light' label-user='' - widget-user='solid-form-auto-completion' + widget-user='solid-form-dropdown-autocompletion-label' submit-button='Ajouter un membre' ) @@ -100,14 +73,28 @@ div.content-box__info div.w280 Nom div.w162 Accès - //-class='table-body' solid-display( class='table-body' bind-resources - fields='members' + nested-field='members' + fields='classGroup(user.account.picture, sup(user.name, user.groups), sub(user.profile.city)), self' loader-id='loader-circle-edit' - multiple-members='' - widget-members='hubl-team-template-edit' + class-classGroup='w280 cell border cell-with-id-card user-thumb is-spaced' + class-user.account.picture='user-thumb__picture avatar' + class-user.name='user-thumb__name' + class-user.groups='user-thumb__groups' + class-user.profile.city='user-thumb__city' + + widget-user.account.picture='hubl-user-avatar' + + multiple-user.groups='' + widget-user.groups='hubl-user-groups' + + action-self='self' + widget-self='circle-edit-members-delete' ) + //- Only to show the table grid + div.w162.cell.border + diff --git a/src/views/circle/page-circle-profile.pug b/src/views/circle/page-circle-profile.pug index 3a699ed..892ba4e 100644 --- a/src/views/circle/page-circle-profile.pug +++ b/src/views/circle/page-circle-profile.pug @@ -3,7 +3,6 @@ solid-router(default-route='circle-profile', hidden) solid-route(name='circle-edit') #circle-profile(hidden) - include ../../templates/hubl-circle-team.pug .content-box__info.flex @@ -23,7 +22,7 @@ solid-router(default-route='circle-profile', hidden) value-title='Date de création : ' - widget-creationDate='solid-display-date' + widget-creationDate='solid-display-value-date' ) solid-ac-checker(permission='acl:Append', bind-resources, nested-field='members') solid-ac-checker(permission='acl:Delete', bind-resources) @@ -38,6 +37,7 @@ solid-router(default-route='circle-profile', hidden) class='button mobile-full-width text-bold text-uppercase button-primary bordered with-icon icon-trash' bind-resources data-label='Supprimer le cercle' + next='admin-circles' ) solid-widget(name='hubl-circle-leave-button') @@ -80,14 +80,26 @@ solid-router(default-route='circle-profile', hidden) h2 Membres : + solid-widget(name='hubl-circle-user-admin') + template ${value ? "Administrateur" : ""} + solid-display.block( bind-resources - fields='members' + nested-field='members' loader-id='loader-circle-profile' + fields='classGroup(user.account.picture, sup(user.name, is_admin), sub(user.profile.city))' - multiple-members='' - widget-members='hubl-circle-team-template' + class-classGroup='user-thumb is-spaced' + class-user.account.picture='avatar user-thumb__picture' + class-user.name='user-thumb__name' + class-is_admin='user-thumb__admin' + class-user.profile.city='user-thumb__city' + + widget-classGroup='solid-set-div' + widget-user.account.picture='hubl-user-avatar' + widget-is_admin='hubl-circle-user-admin' ) + #circle-edit.content-box__height(hidden) include page-circle-edit.pug diff --git a/src/views/job-offer/page-job-offer-create.pug b/src/views/job-offer/page-job-offer-create.pug index 113c06b..9ec9ea9 100644 --- a/src/views/job-offer/page-job-offer-create.pug +++ b/src/views/job-offer/page-job-offer-create.pug @@ -12,12 +12,11 @@ class-description='field form-label is-light is-expanded' label-description='Description*' - widget-description='solid-form-textarea' + widget-description='solid-form-textarea-label' class-skills='form-label is-dark select-skills' label-skills='The required skills for this mission:*' - multiple-skills='solid-multiple-select' - widget-skills='solid-form-auto-completion' + multiple-skills='solid-form-dropdown-autocompletion-label' class-closingDate='form-label is-dark' label-closingDate='Publication end date:*' diff --git a/src/views/job-offer/page-job-offer-edit.pug b/src/views/job-offer/page-job-offer-edit.pug index 5693c91..9ffaebb 100644 --- a/src/views/job-offer/page-job-offer-edit.pug +++ b/src/views/job-offer/page-job-offer-edit.pug @@ -12,12 +12,11 @@ class-description='field form-label is-light is-expanded' label-description='Description*' - widget-description='solid-form-textarea' + widget-description='solid-form-textarea-label' class-skills='form-label is-dark select-skills' label-skills='The required skills for this mission:*' - multiple-skills='solid-multiple-select' - widget-skills='solid-form-auto-completion' + multiple-skills='solid-form-dropdown-autocompletion-label' class-closingDate='form-label is-dark' label-closingDate='Publication end date:*' diff --git a/src/views/project/page-project-edit.pug b/src/views/project/page-project-edit.pug index 82a6c1a..47c8703 100644 --- a/src/views/project/page-project-edit.pug +++ b/src/views/project/page-project-edit.pug @@ -1,6 +1,15 @@ div.content-box__info include ../../templates/hubl-user-avatar.pug + + solid-widget(name="project-edit-members-delete") + template + solid-ac-checker(permission="acl:Delete" data-src="${src}") + solid-delete( + class='button text-bold text-uppercase reversed button-secondary bordered with-icon icon-close' + data-src="${src}" + data-label='Retirer' + ) solid-link(class='backlink right', bind-resources, next='project-profile') Retour @@ -42,7 +51,7 @@ div.content-box__info class-user='team form-label is-light' label-user='' - widget-user='solid-form-auto-completion' + widget-user='solid-form-dropdown-autocompletion-label' submit-button='Ajouter un membre' ) @@ -57,9 +66,21 @@ div.content-box__info solid-display( class='table-body' bind-resources - fields='members' + nested-field='members' + fields='classGroup(user.account.picture, sup(user.name, user.groups), sub(user.profile.city)), self' loader-id='loader-project-edit' - multiple-members='' - widget-members='hubl-team-template-edit' + class-classGroup='w280 cell border cell-with-id-card user-thumb is-spaced' + class-user.account.picture='user-thumb__picture avatar' + class-user.name='user-thumb__name' + class-user.groups='user-thumb__groups' + class-user.profile.city='user-thumb__city' + + widget-user.account.picture='hubl-user-avatar' + + multiple-user.groups='' + widget-user.groups='hubl-user-groups' + + action-self='self' + widget-self='project-edit-members-delete' ) diff --git a/src/views/project/page-project-profile.pug b/src/views/project/page-project-profile.pug index a81fd3e..30d39f2 100644 --- a/src/views/project/page-project-profile.pug +++ b/src/views/project/page-project-profile.pug @@ -4,7 +4,6 @@ solid-router(default-route='project-profile', hidden) #project-profile(hidden) include ../../templates/hubl-captain.pug - include ../../templates/hubl-project-team.pug .content-box__info.flex @@ -24,7 +23,7 @@ solid-router(default-route='project-profile', hidden) value-title='Date de création : ' - widget-creationDate='solid-display-date' + widget-creationDate='solid-display-value-date' ) solid-ac-checker(permission='acl:Append', bind-resources, nested-field='members') solid-ac-checker(permission='acl:Delete', bind-resources) @@ -38,6 +37,7 @@ solid-router(default-route='project-profile', hidden) class='button mobile-full-width text-bold text-uppercase button-primary bordered with-icon icon-trash' bind-resources data-label='Supprimer le projet' + next='admin-projects' ) solid-widget(name='hubl-project-leave-button') @@ -79,12 +79,24 @@ solid-router(default-route='project-profile', hidden) h2 Equipe : + solid-widget(name='hubl-project-user-admin') + template ${value ? "Administrateur" : ""} + solid-display.block( bind-resources - fields='members' + nested-field='members' + fields='classGroup(user.account.picture, sup(user.name, is_admin), sub(user.profile.city, name))' - multiple-members - widget-members='hubl-project-team' + class-classGroup='user-thumb is-spaced' + class-user.account.picture='avatar user-thumb__picture' + class-user.name='user-thumb__name' + class-is_admin='user-thumb__admin' + class-user.profile.city='user-thumb__city' + class-name='user-thumb__lead' + + widget-classGroup='solid-set-div' + widget-user.account.picture='hubl-user-avatar' + widget-is_admin='hubl-project-user-admin' ) #project-edit.content-box__height(hidden) From 067f559fde139c21683fe1b1acd1976b68646fe8 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Mon, 14 Sep 2020 16:07:45 +0200 Subject: [PATCH 11/39] fix: use the long-named solid-form-multipleselect-autocompletion-label widget --- src/styles/base/form.scss | 4 +++- src/views/job-offer/page-job-offer-create.pug | 2 +- src/views/job-offer/page-job-offer-edit.pug | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/styles/base/form.scss b/src/styles/base/form.scss index c241057..52822b9 100644 --- a/src/styles/base/form.scss +++ b/src/styles/base/form.scss @@ -129,6 +129,7 @@ textarea { /* WIDGETS SIB (let in .content-box to override default styles) */ solid-form-dropdown-autocompletion-label, +solid-form-multipleselect-autocompletion-label, hubl-status { .ss-main { @@ -376,7 +377,8 @@ hubl-member-form { margin-bottom: 1rem; } - solid-form-dropdown-autocompletion-label { + solid-form-dropdown-autocompletion-label, + solid-form-multipleselect-autocompletion-label { float: left; } diff --git a/src/views/job-offer/page-job-offer-create.pug b/src/views/job-offer/page-job-offer-create.pug index 9ec9ea9..d3d0c52 100644 --- a/src/views/job-offer/page-job-offer-create.pug +++ b/src/views/job-offer/page-job-offer-create.pug @@ -16,7 +16,7 @@ class-skills='form-label is-dark select-skills' label-skills='The required skills for this mission:*' - multiple-skills='solid-form-dropdown-autocompletion-label' + multiple-skills='solid-form-multipleselect-autocompletion-label' class-closingDate='form-label is-dark' label-closingDate='Publication end date:*' diff --git a/src/views/job-offer/page-job-offer-edit.pug b/src/views/job-offer/page-job-offer-edit.pug index 9ffaebb..e870c3f 100644 --- a/src/views/job-offer/page-job-offer-edit.pug +++ b/src/views/job-offer/page-job-offer-edit.pug @@ -16,7 +16,7 @@ class-skills='form-label is-dark select-skills' label-skills='The required skills for this mission:*' - multiple-skills='solid-form-dropdown-autocompletion-label' + multiple-skills='solid-form-multipleselect-autocompletion-label' class-closingDate='form-label is-dark' label-closingDate='Publication end date:*' From 18bb5a53ee4aa40f928431768e9eaa0f205d4f16 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Tue, 15 Sep 2020 10:32:36 +0200 Subject: [PATCH 12/39] update: toggle the user list on chevron --- src/scripts/menu-toggle.js | 11 +++++++++++ src/styles/base/main.scss | 2 +- src/styles/base/menu-left.scss | 18 +++++++++++++----- 3 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 src/scripts/menu-toggle.js diff --git a/src/scripts/menu-toggle.js b/src/scripts/menu-toggle.js new file mode 100644 index 0000000..8f96670 --- /dev/null +++ b/src/scripts/menu-toggle.js @@ -0,0 +1,11 @@ +document.addEventListener("DOMContentLoaded", () => { + const menuWrappers = Array.from(document.querySelectorAll(".menu-wrapper")); + + //- Toggle sub-menus + menuWrappers.forEach(menuWrapper => { + const menu = menuWrapper.querySelector(".menu"); + menu.addEventListener("click", e => { + menuWrapper.classList.toggle("is-closed"); + }); + }); +}); \ No newline at end of file diff --git a/src/styles/base/main.scss b/src/styles/base/main.scss index 950b85a..835e8db 100644 --- a/src/styles/base/main.scss +++ b/src/styles/base/main.scss @@ -61,7 +61,7 @@ solid-dashboard section { position: sticky; top: 0; overflow-x: hidden; - overflow-y: auto; + overflow-y: scroll; } &.jsLeftMenu { diff --git a/src/styles/base/menu-left.scss b/src/styles/base/menu-left.scss index a018b5d..6996fb6 100644 --- a/src/styles/base/menu-left.scss +++ b/src/styles/base/menu-left.scss @@ -13,13 +13,21 @@ solid-router { .menu-wrapper { - &.is-closed { - .sub-menu { - display: none; + .menu-icon.icon-arrow-up { + visibility: hidden; + } + @include breakpoint(lg) { + .menu-icon.icon-arrow-up { + visibility: visible; } + &.is-closed { + .sub-menu { + display: none; + } - .menu-chevron { - transform: rotate(180deg); + .menu-chevron { + transform: rotate(180deg); + } } } } From 7e99beeb9bc82edc5838f1a8bebb6413a7505bb6 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Tue, 15 Sep 2020 10:58:13 +0200 Subject: [PATCH 13/39] fix: use multiple fields on circle & project edit --- package.json | 4 ++-- src/dependencies.pug | 6 +++--- src/views/circle/page-circle-edit.pug | 7 ++----- src/views/project/page-project-edit.pug | 4 ++-- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 3792914..59aa0ac 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,8 @@ "scripts": { "build": "run-p copy:* build:*", "build:css": "node-sass src/styles/index.scss -o dist/styles/", - "build:js": "babel 'src/scripts/*.js' -o dist/scripts/index.js", - "build:jscomponents": "babel 'src/components/*.js' --out-dir dist/components/", + "build:js": "babel \"src/scripts/*.js\" -o dist/scripts/index.js", + "build:jscomponents": "babel \"src/components/*.js\" --out-dir dist/components/", "build:html": "pug src/index.pug -o dist/ --obj config.json", "copy:font": "copyfiles -f src/fonts/* dist/fonts", "copy:image": "copyfiles -f src/images/* dist/images", diff --git a/src/dependencies.pug b/src/dependencies.pug index ebe9ad9..7ceee9a 100644 --- a/src/dependencies.pug +++ b/src/dependencies.pug @@ -5,13 +5,13 @@ script(type="module" src="/components/hubl-reactivity.js" defer) script(type="module" src="https://unpkg.com/@startinblox/core@beta" defer) //- script(type="module" src="/lib/sib-core/dist/index.js" defer) -script(type="module" src="https://unpkg.com/@startinblox/oidc@beta" defer) +script(type="module" src="https://unpkg.com/@startinblox/oidc" defer) //- script(type="module" src="/lib/sib-auth/index.js" defer) -script(type="module" src="https://unpkg.com/@startinblox/router@beta" defer) +script(type="module" src="https://unpkg.com/@startinblox/router" defer) //- script(type="module" src="/lib/sib-router/src/index.js" defer) -//- script(type="module" src="https://unpkg.com/@startinblox/component-notifications@0.6.2" defer) +script(type="module" src="https://unpkg.com/@startinblox/component-notifications@beta" defer) //- script(type="module" src="/lib/sib-notifications/index.js" defer) if endpoints.events || (endpoints.get && endpoints.get.events) diff --git a/src/views/circle/page-circle-edit.pug b/src/views/circle/page-circle-edit.pug index 800f74b..d772f8f 100644 --- a/src/views/circle/page-circle-edit.pug +++ b/src/views/circle/page-circle-edit.pug @@ -2,9 +2,6 @@ div.content-box__info include ../../templates/hubl-user-avatar.pug - solid-widget(name='hubl-user-groups') - template ${await value.name} - solid-widget(name="circle-edit-members-delete") template solid-ac-checker(permission="acl:Delete" data-src="${src}") @@ -88,8 +85,8 @@ div.content-box__info widget-user.account.picture='hubl-user-avatar' - multiple-user.groups='' - widget-user.groups='hubl-user-groups' + multiple-user.groups + multiple-user.groups-fields='name' action-self='self' widget-self='circle-edit-members-delete' diff --git a/src/views/project/page-project-edit.pug b/src/views/project/page-project-edit.pug index 47c8703..62f8e4f 100644 --- a/src/views/project/page-project-edit.pug +++ b/src/views/project/page-project-edit.pug @@ -78,8 +78,8 @@ div.content-box__info widget-user.account.picture='hubl-user-avatar' - multiple-user.groups='' - widget-user.groups='hubl-user-groups' + multiple-user.groups + multiple-user.groups-fields='name' action-self='self' widget-self='project-edit-members-delete' From 81b1b33bce5da0b9c5fd56faaf97e06a0d1c41cd Mon Sep 17 00:00:00 2001 From: gaelle morin Date: Tue, 15 Sep 2020 15:24:45 +0200 Subject: [PATCH 14/39] feature: circle - private message to member of a circle --- src/styles/base/user-thumb.scss | 15 +++++++++++++++ src/templates/hubl-circle-team.pug | 6 +++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/styles/base/user-thumb.scss b/src/styles/base/user-thumb.scss index 8814efb..487a5de 100644 --- a/src/styles/base/user-thumb.scss +++ b/src/styles/base/user-thumb.scss @@ -37,6 +37,21 @@ margin-right: 1rem; } +.user-thumb__send { + position: relative; + bottom: 7px; + left: -5px; + + solid-link { + @include icon('speech'); + + &::before { + display: inline-block; + color: #FF6765; + } + } +} + .user-thumb__admin:not(:empty) { display: block !important; @extend %tag-admin; diff --git a/src/templates/hubl-circle-team.pug b/src/templates/hubl-circle-team.pug index 2aff831..f3e2f88 100644 --- a/src/templates/hubl-circle-team.pug +++ b/src/templates/hubl-circle-team.pug @@ -4,11 +4,15 @@ solid-widget(name='hubl-circle-team-template') template solid-display.user-thumb.is-spaced( data-src='${await value.user}' - fields='account.picture, sup(name, isadmin), sub(profile.city)' + fields='account.picture, sup(name, send, isadmin), sub(profile.city)' value-isadmin='${await value.is_admin}' + action-send="messages" + label-send="" + class-account.picture='avatar user-thumb__picture' class-name='user-thumb__name' + class-send='user-thumb__send' class-isadmin='user-thumb__admin' class-profile.city='user-thumb__city' From 91dec8717b73240657fd9661dd8e35afff1b626a Mon Sep 17 00:00:00 2001 From: gaelle morin Date: Wed, 16 Sep 2020 14:27:39 +0200 Subject: [PATCH 15/39] feature: circle - private message to member of a project --- src/templates/hubl-project-team.pug | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/templates/hubl-project-team.pug b/src/templates/hubl-project-team.pug index f8334c7..8125a41 100644 --- a/src/templates/hubl-project-team.pug +++ b/src/templates/hubl-project-team.pug @@ -4,12 +4,15 @@ solid-widget(name='hubl-project-team') template solid-display.user-thumb.is-spaced( data-src='${await value}' - fields='user.account.picture, sup(user.name, isadmin), sub(user.profile.city, name)' + fields='user.account.picture, sup(user.name, send, isadmin), sub(user.profile.city, name)' value-isadmin='${await value.is_admin}' - class-user.account.picture='avatar user-thumb__picture' + action-send="messages" + label-send="" + class-user.account.picture='avatar user-thumb__picture' class-user.name='user-thumb__name' + class-send='user-thumb__send' class-isadmin='user-thumb__admin' class-user.profile.city='user-thumb__city' class-name='user-thumb__lead' From 8729e8b6311005f62dbddbd466139768165b1316 Mon Sep 17 00:00:00 2001 From: gaelle morin Date: Wed, 16 Sep 2020 17:19:28 +0200 Subject: [PATCH 16/39] feature: circle - private message to member of a project: widget added --- src/templates/hubl-project-team.pug | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/templates/hubl-project-team.pug b/src/templates/hubl-project-team.pug index 8125a41..76c02c4 100644 --- a/src/templates/hubl-project-team.pug +++ b/src/templates/hubl-project-team.pug @@ -1,18 +1,21 @@ include hubl-user-avatar.pug +solid-widget(name='hubl-project-team-contact') + template + solid-link(data-src='\${value}', next='messages') + solid-widget(name='hubl-project-team') template solid-display.user-thumb.is-spaced( data-src='${await value}' - fields='user.account.picture, sup(user.name, send, isadmin), sub(user.profile.city, name)' + fields='user.account.picture, sup(user.name, user, isadmin), sub(user.profile.city, name)' value-isadmin='${await value.is_admin}' - action-send="messages" - label-send="" + widget-user='hubl-project-team-contact' class-user.account.picture='avatar user-thumb__picture' class-user.name='user-thumb__name' - class-send='user-thumb__send' + class-user='user-thumb__send' class-isadmin='user-thumb__admin' class-user.profile.city='user-thumb__city' class-name='user-thumb__lead' From 01cea418a481faf1318898bd740b86dc2782133d Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Wed, 16 Sep 2020 21:31:26 +0200 Subject: [PATCH 17/39] feature: solid-xmpp-chat Converse IndexedDB Websocket --- src/dependencies.pug | 2 +- src/scripts/unreads-menu.js | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/dependencies.pug b/src/dependencies.pug index a688ab5..685d6da 100644 --- a/src/dependencies.pug +++ b/src/dependencies.pug @@ -31,7 +31,7 @@ if endpoints.dashboards || (endpoints.get && endpoints.get.dashboards) //- script(type="module" src="/lib/solid-dashboard/dist/index.js" defer) if endpoints.users || (endpoints.get && endpoints.get.users) - script(type="module" src="https://unpkg.com/@startinblox/component-chat@0.8" defer) + script(type="module" src="https://unpkg.com/@startinblox/component-chat@1.0" defer) //- script(type="module" src="/lib/solid-xmpp-chat/dist/index.js" defer) script(src="/scripts/index.js" defer) diff --git a/src/scripts/unreads-menu.js b/src/scripts/unreads-menu.js index bd6abc7..ae5dc2c 100644 --- a/src/scripts/unreads-menu.js +++ b/src/scripts/unreads-menu.js @@ -1,7 +1,7 @@ document.addEventListener("DOMContentLoaded", function (event) { window.addEventListener('newMessage', event => { let jid = event.detail.jid; - Array.from(document.querySelectorAll('[data-jabberID="'+jid+'"]')).forEach(el => { + Array.from(document.querySelectorAll('[data-jabberID="' + jid + '"]')).forEach(el => { el.parentElement.parentElement.classList.add('unread'); }); }); @@ -9,7 +9,12 @@ document.addEventListener("DOMContentLoaded", function (event) { window.addEventListener('read', (event) => { if (event.detail && event.detail.resource && event.detail.resource['@id']) { const badge = document.querySelector(`solid-badge[data-src="${event.detail.resource['@id']}"]`); - if (badge) badge.parentElement.parentElement.classList.remove('unread'); + if (badge) { + badge.parentElement.parentElement.classList.remove('unread'); + const project = badge.parentElement.parentElement.querySelector('.unread'); + if (project) project.classList.remove('unread'); + } + } }); }); \ No newline at end of file From 7adfce37ec9de2ed2893631b5fd36b22fe66650a Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Thu, 17 Sep 2020 12:08:42 +0200 Subject: [PATCH 19/39] cicd: don't create cypress video --- cypress.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cypress.json b/cypress.json index 2f9683b..533f1db 100644 --- a/cypress.json +++ b/cypress.json @@ -3,5 +3,6 @@ "defaultCommandTimeout": 60000, "chromeWebSecurity": false, "viewportWidth": 1920, - "viewportHeight": 1080 + "viewportHeight": 1080, + "video": false } From 9a0beef4fb4dbfbce8146c1c50910731a4effd06 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Thu, 17 Sep 2020 12:56:59 +0200 Subject: [PATCH 20/39] cy: testing timeout on dom interactions --- cypress.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress.json b/cypress.json index 533f1db..e9eeb68 100644 --- a/cypress.json +++ b/cypress.json @@ -1,6 +1,6 @@ { "baseUrl": "http://127.0.0.1:3000", - "defaultCommandTimeout": 60000, + "defaultCommandTimeout": 4000, "chromeWebSecurity": false, "viewportWidth": 1920, "viewportHeight": 1080, From 4ab6ab976454f165f3af58285a9dd57ae7922198 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Thu, 17 Sep 2020 13:08:44 +0200 Subject: [PATCH 21/39] cy: no more naviagte --- cypress/integration/create-channel.spec.js | 21 +++++++++++++++++--- cypress/integration/create-job-offer.spec.js | 7 ++++++- cypress/integration/create-project.spec.js | 14 +++++++++++-- cypress/integration/create-user.spec.js | 7 ++++++- cypress/integration/delete-channel.spec.js | 12 +++++++++-- cypress/integration/edit-channel.spec.js | 12 +++++++++-- cypress/integration/edit-job-offer.spec.js | 12 +++++++++-- cypress/integration/edit-project.spec.js | 14 ++++++++++--- cypress/integration/edit-user.spec.js | 7 ++++++- cypress/integration/leave-channel.spec.js | 7 ++++++- cypress/integration/leave-project.spec.js | 7 ++++++- cypress/integration/list-job-offers.spec.js | 7 ++++++- cypress/integration/list-users.spec.js | 7 ++++++- cypress/integration/retire-channel.spec.js | 12 +++++++++-- cypress/integration/retire-project.spec.js | 12 +++++++++-- cypress/support/commands.js | 7 ------- 16 files changed, 133 insertions(+), 32 deletions(-) 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) => { From 0441d5fb1ae2f8e61367c4be2a09ebb10b4195a1 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Thu, 17 Sep 2020 13:17:55 +0200 Subject: [PATCH 22/39] fix: typo --- cypress/integration/edit-project.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/integration/edit-project.spec.js b/cypress/integration/edit-project.spec.js index ba34765..f3d7c54 100644 --- a/cypress/integration/edit-project.spec.js +++ b/cypress/integration/edit-project.spec.js @@ -34,7 +34,7 @@ context('Edit Project Browser Testing', () => { it('should visit the last project edit screen', () => { cy.get(menuQuery.join(' ')) .invoke('attr', 'data-src') - .then(url => cy.encodeUrl(url).then(id => {{ + .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'); From 79ad8f410483e16086d56cdda8adb103f93fbe12 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Thu, 17 Sep 2020 13:27:46 +0200 Subject: [PATCH 23/39] cy: timeout on dom to 1 sec --- cypress.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress.json b/cypress.json index e9eeb68..eaf2081 100644 --- a/cypress.json +++ b/cypress.json @@ -1,6 +1,6 @@ { "baseUrl": "http://127.0.0.1:3000", - "defaultCommandTimeout": 4000, + "defaultCommandTimeout": 1000, "chromeWebSecurity": false, "viewportWidth": 1920, "viewportHeight": 1080, From 8369cfbd753513c996b32c3741bdbd35a878db48 Mon Sep 17 00:00:00 2001 From: gaelle morin Date: Thu, 17 Sep 2020 19:41:39 +0200 Subject: [PATCH 24/39] update: styles for project- and circle-edit --- "\033" | 30 +++++++++++++++++++++++++ src/dependencies.pug | 10 ++++----- src/styles/base/form.scss | 7 +++++- src/styles/base/table.scss | 9 ++++---- src/styles/base/user-thumb.scss | 3 ++- src/views/circle/page-circle-edit.pug | 4 ++-- src/views/project/page-project-edit.pug | 4 ++-- 7 files changed, 52 insertions(+), 15 deletions(-) create mode 100644 "\033" diff --git "a/\033" "b/\033" new file mode 100644 index 0000000..2e96443 --- /dev/null +++ "b/\033" @@ -0,0 +1,30 @@ +diff --git a/src/dependencies.pug b/src/dependencies.pug +index 7ceee9a..d4a7c72 100644 +--- a/src/dependencies.pug ++++ b/src/dependencies.pug +@@ -19,12 +19,12 @@ if endpoints.events || (endpoints.get && endpoints.get.events) + //- script(type="module" src="/lib/sib-event/sib-event.js" defer) +  + if endpoints.joboffers || (endpoints.get && endpoints.get.joboffers) +- script(type="module" src="https://unpkg.com/@startinblox/component-job-board@beta" defer) +- //- script(type="module" src="/lib/solid-job-board/dist/index.js" defer) ++ //- script(type="module" src="https://unpkg.com/@startinblox/component-job-board@beta" defer) ++ script(type="module" src="/lib/solid-job-board/dist/index.js" defer) +  + if (endpoints.uploads || (endpoints.get && endpoints.get.uploads)) && (endpoints.skills || (endpoints.get && endpoints.get.skills)) && (endpoints.users || (endpoints.get && endpoints.get.users)) +- script(type="module" src="https://unpkg.com/@startinblox/component-directory@beta" defer) +- //- script(type="module" src="/lib/solid-directory/dist/index.js" defer) ++ //- script(type="module" src="https://unpkg.com/@startinblox/component-directory@beta" defer) ++ script(type="module" src="/lib/solid-directory/dist/index.js" defer) +  + if endpoints.dashboards || (endpoints.get && endpoints.get.dashboards) + script(type="module" src="https://unpkg.com/@startinblox/component-dashboard@beta" defer) +@@ -32,7 +32,7 @@ if endpoints.dashboards || (endpoints.get && endpoints.get.dashboards) +  + if endpoints.users || (endpoints.get && endpoints.get.users) + //- script(type="module" src="https://unpkg.com/@startinblox/component-chat@0.8" defer) +- //- script(type="module" src="/lib/solid-xmpp-chat/dist/index.js" defer) ++ script(type="module" src="/lib/solid-xmpp-chat/dist/index.js" defer) +  + script(src="/scripts/index.js" defer) +  diff --git a/src/dependencies.pug b/src/dependencies.pug index 7ceee9a..d4a7c72 100644 --- a/src/dependencies.pug +++ b/src/dependencies.pug @@ -19,12 +19,12 @@ if endpoints.events || (endpoints.get && endpoints.get.events) //- script(type="module" src="/lib/sib-event/sib-event.js" defer) if endpoints.joboffers || (endpoints.get && endpoints.get.joboffers) - script(type="module" src="https://unpkg.com/@startinblox/component-job-board@beta" defer) - //- script(type="module" src="/lib/solid-job-board/dist/index.js" defer) + //- script(type="module" src="https://unpkg.com/@startinblox/component-job-board@beta" defer) + script(type="module" src="/lib/solid-job-board/dist/index.js" defer) if (endpoints.uploads || (endpoints.get && endpoints.get.uploads)) && (endpoints.skills || (endpoints.get && endpoints.get.skills)) && (endpoints.users || (endpoints.get && endpoints.get.users)) - script(type="module" src="https://unpkg.com/@startinblox/component-directory@beta" defer) - //- script(type="module" src="/lib/solid-directory/dist/index.js" defer) + //- script(type="module" src="https://unpkg.com/@startinblox/component-directory@beta" defer) + script(type="module" src="/lib/solid-directory/dist/index.js" defer) if endpoints.dashboards || (endpoints.get && endpoints.get.dashboards) script(type="module" src="https://unpkg.com/@startinblox/component-dashboard@beta" defer) @@ -32,7 +32,7 @@ if endpoints.dashboards || (endpoints.get && endpoints.get.dashboards) if endpoints.users || (endpoints.get && endpoints.get.users) //- script(type="module" src="https://unpkg.com/@startinblox/component-chat@0.8" defer) - //- script(type="module" src="/lib/solid-xmpp-chat/dist/index.js" defer) + script(type="module" src="/lib/solid-xmpp-chat/dist/index.js" defer) script(src="/scripts/index.js" defer) diff --git a/src/styles/base/form.scss b/src/styles/base/form.scss index 52822b9..86e89b7 100644 --- a/src/styles/base/form.scss +++ b/src/styles/base/form.scss @@ -132,6 +132,10 @@ solid-form-dropdown-autocompletion-label, solid-form-multipleselect-autocompletion-label, hubl-status { + label { + display: none; + } + .ss-main { font-weight: normal; text-transform: none; @@ -143,7 +147,6 @@ hubl-status { border-radius: 0px; color: var(--color-input-text); font-weight: normal; - margin-top: 0.8rem; min-height: 4.6rem; padding-left: 1.2rem; @@ -178,6 +181,7 @@ hubl-status { display: flex; flex-direction: row; margin-bottom: 2.6rem; + margin-top: 1.8rem; } label { @@ -198,6 +202,7 @@ hubl-status { width: 100%; @include breakpoint(lg) { + height: 32px; margin: auto 0 auto 2.2rem; width: auto; } diff --git a/src/styles/base/table.scss b/src/styles/base/table.scss index 6ecc645..9616f77 100644 --- a/src/styles/base/table.scss +++ b/src/styles/base/table.scss @@ -46,13 +46,14 @@ &>* { border-bottom: 1px solid var(--color-table-border); display: table-cell; + text-align: center; vertical-align: middle; } } } - &>solid-multiple { - display: contents; + /*&>solid-multiple { + display: contents;*/ &>div { display: contents; @@ -68,7 +69,7 @@ } } } - } + /*}*/ } } } @@ -163,7 +164,7 @@ /* Styles of elements inside cells */ -.user-thumb>div, +.user-thumb, [name='user-thumb'] { vertical-align: middle; text-align: left; diff --git a/src/styles/base/user-thumb.scss b/src/styles/base/user-thumb.scss index 8814efb..7d7166b 100644 --- a/src/styles/base/user-thumb.scss +++ b/src/styles/base/user-thumb.scss @@ -79,6 +79,7 @@ /* Apply the grids to all user-thumbs */ .user-thumb>div, +.user-thumb>[name='classGrid'], [name='user-thumb'] { @extend %user-thumb__grid; @@ -92,7 +93,7 @@ } /* Add extra spaces to user-thumbs that are inside a table */ -.user-thumb.is-spaced>div, +.user-thumb.is-spaced, [name='user-thumb'] { padding: 0.8rem 2.2rem; } diff --git a/src/views/circle/page-circle-edit.pug b/src/views/circle/page-circle-edit.pug index d772f8f..5f7c066 100644 --- a/src/views/circle/page-circle-edit.pug +++ b/src/views/circle/page-circle-edit.pug @@ -57,7 +57,7 @@ div.content-box__info fields='user' range-user=`${endpoints.users || endpoints.get.users}` - class-user='team form-label is-light' + class-user='team' label-user='' widget-user='solid-form-dropdown-autocompletion-label' @@ -74,7 +74,7 @@ div.content-box__info class='table-body' bind-resources nested-field='members' - fields='classGroup(user.account.picture, sup(user.name, user.groups), sub(user.profile.city)), self' + fields='classGroup(classGrid(user.account.picture, sup(user.name, user.groups), sub(user.profile.city))), self' loader-id='loader-circle-edit' class-classGroup='w280 cell border cell-with-id-card user-thumb is-spaced' diff --git a/src/views/project/page-project-edit.pug b/src/views/project/page-project-edit.pug index 62f8e4f..5ab03de 100644 --- a/src/views/project/page-project-edit.pug +++ b/src/views/project/page-project-edit.pug @@ -49,7 +49,7 @@ div.content-box__info fields='user' range-user=`${endpoints.users || endpoints.get.users}` - class-user='team form-label is-light' + class-user='team' label-user='' widget-user='solid-form-dropdown-autocompletion-label' @@ -67,7 +67,7 @@ div.content-box__info class='table-body' bind-resources nested-field='members' - fields='classGroup(user.account.picture, sup(user.name, user.groups), sub(user.profile.city)), self' + fields='classGroup(classGrid(user.account.picture, sup(user.name, user.groups), sub(user.profile.city))), self' loader-id='loader-project-edit' class-classGroup='w280 cell border cell-with-id-card user-thumb is-spaced' From 4e29918ec4c5d00ee22b709497be4710ca8c049c Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Fri, 18 Sep 2020 11:38:31 +0200 Subject: [PATCH 25/39] bugfix: hide arrow on menu --- src/menu-left.pug | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/menu-left.pug b/src/menu-left.pug index 6538c09..93304e5 100644 --- a/src/menu-left.pug +++ b/src/menu-left.pug @@ -74,7 +74,8 @@ solid-router#navbar-router(default-route='dashboard') solid-link(next='admin-project-list') div.menu div.menu-chevron - div.menu-icon.icon-arrow-right-circle + div.menu-icon + //- div.menu-icon.icon-arrow-right-circle div.menu-label Projets div.menu-icon.icon-folder-alt solid-route(name='project', rdf-type='hd:project', use-id='', hidden) @@ -101,7 +102,8 @@ solid-router#navbar-router(default-route='dashboard') solid-link(next='admin-circle-list') div.menu div.menu-chevron - div.menu-icon.icon-arrow-right-circle + div.menu-icon + //- div.menu-icon.icon-arrow-right-circle div.menu-label Cercles div.menu-icon.icon-folder-alt solid-route(name='circle', rdf-type='hd:circle', use-id='', hidden) From 61a7bfd222753a9168199efbb3117e627c29e8f8 Mon Sep 17 00:00:00 2001 From: gaelle morin Date: Mon, 21 Sep 2020 15:25:46 +0200 Subject: [PATCH 26/39] update: dependencies.pug to beta --- src/dependencies.pug | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/dependencies.pug b/src/dependencies.pug index d4a7c72..78c64e7 100644 --- a/src/dependencies.pug +++ b/src/dependencies.pug @@ -19,20 +19,20 @@ if endpoints.events || (endpoints.get && endpoints.get.events) //- script(type="module" src="/lib/sib-event/sib-event.js" defer) if endpoints.joboffers || (endpoints.get && endpoints.get.joboffers) - //- script(type="module" src="https://unpkg.com/@startinblox/component-job-board@beta" defer) - script(type="module" src="/lib/solid-job-board/dist/index.js" defer) + script(type="module" src="https://unpkg.com/@startinblox/component-job-board@beta" defer) + //- script(type="module" src="/lib/solid-job-board/dist/index.js" defer) if (endpoints.uploads || (endpoints.get && endpoints.get.uploads)) && (endpoints.skills || (endpoints.get && endpoints.get.skills)) && (endpoints.users || (endpoints.get && endpoints.get.users)) - //- script(type="module" src="https://unpkg.com/@startinblox/component-directory@beta" defer) - script(type="module" src="/lib/solid-directory/dist/index.js" defer) + script(type="module" src="https://unpkg.com/@startinblox/component-directory@beta" defer) + //- script(type="module" src="/lib/solid-directory/dist/index.js" defer) if endpoints.dashboards || (endpoints.get && endpoints.get.dashboards) script(type="module" src="https://unpkg.com/@startinblox/component-dashboard@beta" defer) //- script(type="module" src="/lib/solid-dashboard/dist/index.js" defer) if endpoints.users || (endpoints.get && endpoints.get.users) - //- script(type="module" src="https://unpkg.com/@startinblox/component-chat@0.8" defer) - script(type="module" src="/lib/solid-xmpp-chat/dist/index.js" defer) + script(type="module" src="https://unpkg.com/@startinblox/component-chat@0.8" defer) + //- script(type="module" src="/lib/solid-xmpp-chat/dist/index.js" defer) script(src="/scripts/index.js" defer) From 9faf5ad6ac56f9810fcc4832df3dd497ff0fa02c Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Tue, 22 Sep 2020 13:03:05 +0200 Subject: [PATCH 27/39] fix: links on left menu --- src/menu-left.pug | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/menu-left.pug b/src/menu-left.pug index 93304e5..3180ce7 100644 --- a/src/menu-left.pug +++ b/src/menu-left.pug @@ -71,7 +71,8 @@ solid-router#navbar-router(default-route='dashboard') div.divider if endpoints.projects || (endpoints.get && endpoints.get.projects) div - solid-link(next='admin-project-list') + solid-link + //- (next='admin-project-list') div.menu div.menu-chevron div.menu-icon @@ -99,7 +100,8 @@ solid-router#navbar-router(default-route='dashboard') div.divider if endpoints.circles || (endpoints.get && endpoints.get.circles) div - solid-link(next='admin-circle-list') + solid-link + //- (next='admin-circle-list') div.menu div.menu-chevron div.menu-icon From 3f840a3005d043cedc87a8376f3d111d45fedace Mon Sep 17 00:00:00 2001 From: gaelle morin Date: Tue, 22 Sep 2020 16:10:22 +0200 Subject: [PATCH 28/39] update: padding for admin-circles and -projects + send and edit icons rounded --- src/dependencies.pug | 2 +- src/styles/base/main.scss | 10 ++++++++++ src/styles/base/table.scss | 5 ++++- src/views/admin/page-admin-circles.pug | 6 +++--- src/views/admin/page-admin-projects.pug | 6 +++--- 5 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/dependencies.pug b/src/dependencies.pug index 78c64e7..7ceee9a 100644 --- a/src/dependencies.pug +++ b/src/dependencies.pug @@ -31,7 +31,7 @@ if endpoints.dashboards || (endpoints.get && endpoints.get.dashboards) //- script(type="module" src="/lib/solid-dashboard/dist/index.js" defer) if endpoints.users || (endpoints.get && endpoints.get.users) - script(type="module" src="https://unpkg.com/@startinblox/component-chat@0.8" defer) + //- script(type="module" src="https://unpkg.com/@startinblox/component-chat@0.8" defer) //- script(type="module" src="/lib/solid-xmpp-chat/dist/index.js" defer) script(src="/scripts/index.js" defer) diff --git a/src/styles/base/main.scss b/src/styles/base/main.scss index 950b85a..6a74e9b 100644 --- a/src/styles/base/main.scss +++ b/src/styles/base/main.scss @@ -568,6 +568,10 @@ h5 { text-align: center; } +.block { + display: block; +} + .flex { display: flex; } @@ -700,6 +704,12 @@ a, border-radius: 50%; font-size: 1.8rem; padding: 1rem; + height: 42px; + width: 42px; + display: flex; + align-items: center; + justify-content: center; + margin: 0 auto; } &.button-link { diff --git a/src/styles/base/table.scss b/src/styles/base/table.scss index 9616f77..0272915 100644 --- a/src/styles/base/table.scss +++ b/src/styles/base/table.scss @@ -153,6 +153,10 @@ .desktop-btn-margin__left; } } + + &.is-spaced { + padding: 0.8rem 2.2rem; + } } .cell-with-name { @@ -164,7 +168,6 @@ /* Styles of elements inside cells */ -.user-thumb, [name='user-thumb'] { vertical-align: middle; text-align: left; diff --git a/src/views/admin/page-admin-circles.pug b/src/views/admin/page-admin-circles.pug index b545c7b..a75f432 100644 --- a/src/views/admin/page-admin-circles.pug +++ b/src/views/admin/page-admin-circles.pug @@ -15,7 +15,7 @@ solid-widget(name='hubl-circle-owner') template - solid-display.user-thumb.is-spaced( + solid-display.user-thumb.block.is-spaced( data-src='${await value}' fields='account.picture, sup(name), sub(username)' @@ -70,7 +70,7 @@ class-circle.name='w280 border cell-with-name' class-circle.owner='w280 border cell-with-id-card' - class-leaveButton='w280 border cell-with-buttons' + class-leaveButton='w280 border cell-with-buttons is-spaced' action-leaveButton="joinButton" widget-leaveButton="hubl-admin-circle-leave-button" @@ -108,7 +108,7 @@ class-owner='w280 border cell-with-id-card' widget-owner='hubl-circle-owner' - class-members='w280 border cell-with-buttons' + class-members='w280 border cell-with-buttons is-spaced' widget-members="hubl-admin-circle-join-button" order-by="name" diff --git a/src/views/admin/page-admin-projects.pug b/src/views/admin/page-admin-projects.pug index c0268b6..d984c27 100644 --- a/src/views/admin/page-admin-projects.pug +++ b/src/views/admin/page-admin-projects.pug @@ -46,7 +46,7 @@ solid-widget(name='hubl-project-captain') template - solid-display.user-thumb.is-spaced( + solid-display.user-thumb.block.is-spaced( data-src='${await value}' fields='account.picture, sup(name), sub(username)' @@ -87,7 +87,7 @@ class-project.name='w280 cell border cell-with-name' class-project.members='w280 cell border cell-with-id-card' class-project.captain='w280 cell border cell-with-id-card' - class-leaveButton='w230 cell border cell-with-buttons' + class-leaveButton='w230 cell border cell-with-buttons is-spaced' action-leaveButton="joinButton" widget-leaveButton="hubl-admin-project-leave-button" @@ -127,7 +127,7 @@ class-name='w280 cell border cell-with-name' class-members='w280 cell border cell-with-id-card' class-captain='w280 cell border cell-with-id-card' - class-joinButton='w230 cell border cell-with-buttons' + class-joinButton='w230 cell border cell-with-buttons is-spaced' action-joinButton="joinButton" # Workaround: I need members two times widget-joinButton="hubl-admin-project-join-button" From 36097e96e13eb3f9a69e7ddf0e13e4cce76f26bd Mon Sep 17 00:00:00 2001 From: gaelle morin Date: Tue, 22 Sep 2020 16:25:21 +0200 Subject: [PATCH 29/39] update: chat dependancy --- src/dependencies.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dependencies.pug b/src/dependencies.pug index 7ceee9a..24ec0b8 100644 --- a/src/dependencies.pug +++ b/src/dependencies.pug @@ -31,7 +31,7 @@ if endpoints.dashboards || (endpoints.get && endpoints.get.dashboards) //- script(type="module" src="/lib/solid-dashboard/dist/index.js" defer) if endpoints.users || (endpoints.get && endpoints.get.users) - //- script(type="module" src="https://unpkg.com/@startinblox/component-chat@0.8" defer) + script(type="module" src="https://unpkg.com/@startinblox/component-chat@beta" defer) //- script(type="module" src="/lib/solid-xmpp-chat/dist/index.js" defer) script(src="/scripts/index.js" defer) From 8fda5091a56708d3d3f20663d3cb4a93904e683d Mon Sep 17 00:00:00 2001 From: gaelle morin Date: Tue, 22 Sep 2020 16:41:11 +0200 Subject: [PATCH 30/39] update: weird file removed --- "\033" | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 "\033" diff --git "a/\033" "b/\033" deleted file mode 100644 index 2e96443..0000000 --- "a/\033" +++ /dev/null @@ -1,30 +0,0 @@ -diff --git a/src/dependencies.pug b/src/dependencies.pug -index 7ceee9a..d4a7c72 100644 ---- a/src/dependencies.pug -+++ b/src/dependencies.pug -@@ -19,12 +19,12 @@ if endpoints.events || (endpoints.get && endpoints.get.events) - //- script(type="module" src="/lib/sib-event/sib-event.js" defer) -  - if endpoints.joboffers || (endpoints.get && endpoints.get.joboffers) -- script(type="module" src="https://unpkg.com/@startinblox/component-job-board@beta" defer) -- //- script(type="module" src="/lib/solid-job-board/dist/index.js" defer) -+ //- script(type="module" src="https://unpkg.com/@startinblox/component-job-board@beta" defer) -+ script(type="module" src="/lib/solid-job-board/dist/index.js" defer) -  - if (endpoints.uploads || (endpoints.get && endpoints.get.uploads)) && (endpoints.skills || (endpoints.get && endpoints.get.skills)) && (endpoints.users || (endpoints.get && endpoints.get.users)) -- script(type="module" src="https://unpkg.com/@startinblox/component-directory@beta" defer) -- //- script(type="module" src="/lib/solid-directory/dist/index.js" defer) -+ //- script(type="module" src="https://unpkg.com/@startinblox/component-directory@beta" defer) -+ script(type="module" src="/lib/solid-directory/dist/index.js" defer) -  - if endpoints.dashboards || (endpoints.get && endpoints.get.dashboards) - script(type="module" src="https://unpkg.com/@startinblox/component-dashboard@beta" defer) -@@ -32,7 +32,7 @@ if endpoints.dashboards || (endpoints.get && endpoints.get.dashboards) -  - if endpoints.users || (endpoints.get && endpoints.get.users) - //- script(type="module" src="https://unpkg.com/@startinblox/component-chat@0.8" defer) -- //- script(type="module" src="/lib/solid-xmpp-chat/dist/index.js" defer) -+ script(type="module" src="/lib/solid-xmpp-chat/dist/index.js" defer) -  - script(src="/scripts/index.js" defer) -  From 1a6345a2e30120b10321936f0c57b257ae574d77 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Wed, 23 Sep 2020 12:15:54 +0200 Subject: [PATCH 31/39] minor: core@0.12 --- src/components/hubl-reactivity.js | 6 +++--- src/components/hubl-search-users.js | 2 +- src/components/hubl-status.js | 4 ++-- src/dependencies.pug | 16 ++++++++-------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/components/hubl-reactivity.js b/src/components/hubl-reactivity.js index 261ef6e..443a517 100644 --- a/src/components/hubl-reactivity.js +++ b/src/components/hubl-reactivity.js @@ -1,6 +1,6 @@ -import { store } from 'https://unpkg.com/@startinblox/core@beta'; -import { Sib } from "https://unpkg.com/@startinblox/core@beta/dist/libs/Sib.js"; -import { StoreMixin } from "https://unpkg.com/@startinblox/core@beta/dist/mixins/storeMixin.js"; +import { store } from 'https://unpkg.com/@startinblox/core@0.12'; +import { Sib } from "https://unpkg.com/@startinblox/core@0.12/dist/libs/Sib.js"; +import { StoreMixin } from "https://unpkg.com/@startinblox/core@0.12/dist/mixins/storeMixin.js"; export const HublReactivity = { name: 'hubl-reactivity', diff --git a/src/components/hubl-search-users.js b/src/components/hubl-search-users.js index fafae32..b640f3b 100644 --- a/src/components/hubl-search-users.js +++ b/src/components/hubl-search-users.js @@ -1,4 +1,4 @@ -import { widgetFactory } from 'https://unpkg.com/@startinblox/core@beta/dist/widgets/widget-factory.js'; +import { widgetFactory } from 'https://unpkg.com/@startinblox/core@0.12/dist/widgets/widget-factory.js'; const HublSearchUsers = widgetFactory( 'hubl-search-users', diff --git a/src/components/hubl-status.js b/src/components/hubl-status.js index c9acf4b..15b4b1f 100644 --- a/src/components/hubl-status.js +++ b/src/components/hubl-status.js @@ -1,5 +1,5 @@ -import { widgetFactory } from 'https://unpkg.com/@startinblox/core@beta/dist/widgets/widget-factory.js'; -import { importCSS } from 'https://unpkg.com/@startinblox/core@beta/dist/libs/helpers.js'; +import { widgetFactory } from 'https://unpkg.com/@startinblox/core@0.12/dist/widgets/widget-factory.js'; +import { importCSS } from 'https://unpkg.com/@startinblox/core@0.12/dist/libs/helpers.js'; import SlimSelect from 'https://dev.jspm.io/slim-select@1.23'; const HublStatus = widgetFactory( diff --git a/src/dependencies.pug b/src/dependencies.pug index 24ec0b8..3e44caf 100644 --- a/src/dependencies.pug +++ b/src/dependencies.pug @@ -2,16 +2,16 @@ script(type="module" src="/components/hubl-search-users.js" defer) script(type="module" src="/components/hubl-status.js" defer) script(type="module" src="/components/hubl-reactivity.js" defer) -script(type="module" src="https://unpkg.com/@startinblox/core@beta" defer) +script(type="module" src="https://unpkg.com/@startinblox/core@0.12" defer) //- script(type="module" src="/lib/sib-core/dist/index.js" defer) -script(type="module" src="https://unpkg.com/@startinblox/oidc" defer) +script(type="module" src="https://unpkg.com/@startinblox/oidc@0.10" defer) //- script(type="module" src="/lib/sib-auth/index.js" defer) -script(type="module" src="https://unpkg.com/@startinblox/router" defer) +script(type="module" src="https://unpkg.com/@startinblox/router@0.9" defer) //- script(type="module" src="/lib/sib-router/src/index.js" defer) -script(type="module" src="https://unpkg.com/@startinblox/component-notifications@beta" defer) +//- script(type="module" src="https://unpkg.com/@startinblox/component-notifications@beta" defer) //- script(type="module" src="/lib/sib-notifications/index.js" defer) if endpoints.events || (endpoints.get && endpoints.get.events) @@ -19,19 +19,19 @@ if endpoints.events || (endpoints.get && endpoints.get.events) //- script(type="module" src="/lib/sib-event/sib-event.js" defer) if endpoints.joboffers || (endpoints.get && endpoints.get.joboffers) - script(type="module" src="https://unpkg.com/@startinblox/component-job-board@beta" defer) + script(type="module" src="https://unpkg.com/@startinblox/component-job-board@0.7" defer) //- script(type="module" src="/lib/solid-job-board/dist/index.js" defer) if (endpoints.uploads || (endpoints.get && endpoints.get.uploads)) && (endpoints.skills || (endpoints.get && endpoints.get.skills)) && (endpoints.users || (endpoints.get && endpoints.get.users)) - script(type="module" src="https://unpkg.com/@startinblox/component-directory@beta" defer) + script(type="module" src="https://unpkg.com/@startinblox/component-directory@0.8" defer) //- script(type="module" src="/lib/solid-directory/dist/index.js" defer) if endpoints.dashboards || (endpoints.get && endpoints.get.dashboards) - script(type="module" src="https://unpkg.com/@startinblox/component-dashboard@beta" defer) + script(type="module" src="https://unpkg.com/@startinblox/component-dashboard@0.5" defer) //- script(type="module" src="/lib/solid-dashboard/dist/index.js" defer) if endpoints.users || (endpoints.get && endpoints.get.users) - script(type="module" src="https://unpkg.com/@startinblox/component-chat@beta" defer) + script(type="module" src="https://unpkg.com/@startinblox/component-chat@1.1" defer) //- script(type="module" src="/lib/solid-xmpp-chat/dist/index.js" defer) script(src="/scripts/index.js" defer) From e7a416b2f9a964fefebdb511ffc095802bc4ee97 Mon Sep 17 00:00:00 2001 From: gaelle morin Date: Wed, 23 Sep 2020 16:51:45 +0200 Subject: [PATCH 32/39] update: dependancies + styles for select --- src/dependencies.pug | 12 ++++++------ src/styles/base/form.scss | 5 +---- src/styles/base/table.scss | 21 +++++---------------- src/styles/base/user-thumb.scss | 7 +------ 4 files changed, 13 insertions(+), 32 deletions(-) diff --git a/src/dependencies.pug b/src/dependencies.pug index 24ec0b8..8060f30 100644 --- a/src/dependencies.pug +++ b/src/dependencies.pug @@ -19,20 +19,20 @@ if endpoints.events || (endpoints.get && endpoints.get.events) //- script(type="module" src="/lib/sib-event/sib-event.js" defer) if endpoints.joboffers || (endpoints.get && endpoints.get.joboffers) - script(type="module" src="https://unpkg.com/@startinblox/component-job-board@beta" defer) - //- script(type="module" src="/lib/solid-job-board/dist/index.js" defer) + //- script(type="module" src="https://unpkg.com/@startinblox/component-job-board@beta" defer) + script(type="module" src="/lib/solid-job-board/dist/index.js" defer) if (endpoints.uploads || (endpoints.get && endpoints.get.uploads)) && (endpoints.skills || (endpoints.get && endpoints.get.skills)) && (endpoints.users || (endpoints.get && endpoints.get.users)) - script(type="module" src="https://unpkg.com/@startinblox/component-directory@beta" defer) - //- script(type="module" src="/lib/solid-directory/dist/index.js" defer) + //- script(type="module" src="https://unpkg.com/@startinblox/component-directory@beta" defer) + script(type="module" src="/lib/solid-directory/dist/index.js" defer) if endpoints.dashboards || (endpoints.get && endpoints.get.dashboards) script(type="module" src="https://unpkg.com/@startinblox/component-dashboard@beta" defer) //- script(type="module" src="/lib/solid-dashboard/dist/index.js" defer) if endpoints.users || (endpoints.get && endpoints.get.users) - script(type="module" src="https://unpkg.com/@startinblox/component-chat@beta" defer) - //- script(type="module" src="/lib/solid-xmpp-chat/dist/index.js" defer) + //- script(type="module" src="https://unpkg.com/@startinblox/component-chat@beta" defer) + script(type="module" src="/lib/solid-xmpp-chat/dist/index.js" defer) script(src="/scripts/index.js" defer) diff --git a/src/styles/base/form.scss b/src/styles/base/form.scss index 86e89b7..de97e77 100644 --- a/src/styles/base/form.scss +++ b/src/styles/base/form.scss @@ -132,12 +132,9 @@ solid-form-dropdown-autocompletion-label, solid-form-multipleselect-autocompletion-label, hubl-status { - label { - display: none; - } - .ss-main { font-weight: normal; + margin-top: 0.8rem; text-transform: none; diff --git a/src/styles/base/table.scss b/src/styles/base/table.scss index 0272915..c82e4c5 100644 --- a/src/styles/base/table.scss +++ b/src/styles/base/table.scss @@ -168,22 +168,11 @@ /* Styles of elements inside cells */ -[name='user-thumb'] { - vertical-align: middle; - text-align: left; - @extend %user-thumb__grid; - padding: 0 2.2rem; - - >.user-thumb__picture { - @extend .user-thumb__picture; - } - - >[name='sup'] { - @extend %user-thumb__grid-sup; - } - - >[name='sub'] { - @extend %user-thumb__grid-inf; +.table { + + .user-thumb.is-spaced, + [name='user-thumb'] { + padding: 0.8rem 2.2rem; } } diff --git a/src/styles/base/user-thumb.scss b/src/styles/base/user-thumb.scss index 7d7166b..394e5e7 100644 --- a/src/styles/base/user-thumb.scss +++ b/src/styles/base/user-thumb.scss @@ -35,6 +35,7 @@ color: var(--color-user-thumb-name); font-weight: 600; margin-right: 1rem; + text-align: left; } .user-thumb__admin:not(:empty) { @@ -91,9 +92,3 @@ @extend %user-thumb__grid-inf; } } - -/* Add extra spaces to user-thumbs that are inside a table */ -.user-thumb.is-spaced, -[name='user-thumb'] { - padding: 0.8rem 2.2rem; -} From 97e0fe62b43a5f885a14e23180aa994e0eed75ce Mon Sep 17 00:00:00 2001 From: gaelle morin Date: Wed, 23 Sep 2020 17:25:38 +0200 Subject: [PATCH 33/39] update: dependancies + new widget for some selects in circle and project -edit --- src/styles/base/form.scss | 1 + src/views/circle/page-circle-edit.pug | 3 +-- src/views/project/page-project-edit.pug | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/styles/base/form.scss b/src/styles/base/form.scss index de97e77..cf3908a 100644 --- a/src/styles/base/form.scss +++ b/src/styles/base/form.scss @@ -128,6 +128,7 @@ textarea { /* WIDGETS SIB (let in .content-box to override default styles) */ +solid-form-dropdown-autocompletion, solid-form-dropdown-autocompletion-label, solid-form-multipleselect-autocompletion-label, hubl-status { diff --git a/src/views/circle/page-circle-edit.pug b/src/views/circle/page-circle-edit.pug index 5f7c066..b222af2 100644 --- a/src/views/circle/page-circle-edit.pug +++ b/src/views/circle/page-circle-edit.pug @@ -58,8 +58,7 @@ div.content-box__info range-user=`${endpoints.users || endpoints.get.users}` class-user='team' - label-user='' - widget-user='solid-form-dropdown-autocompletion-label' + widget-user='solid-form-dropdown-autocompletion' submit-button='Ajouter un membre' ) diff --git a/src/views/project/page-project-edit.pug b/src/views/project/page-project-edit.pug index 5ab03de..16e249d 100644 --- a/src/views/project/page-project-edit.pug +++ b/src/views/project/page-project-edit.pug @@ -51,7 +51,7 @@ div.content-box__info class-user='team' label-user='' - widget-user='solid-form-dropdown-autocompletion-label' + widget-user='solid-form-dropdown-autocompletion' submit-button='Ajouter un membre' ) From 3fdc07d6c476f460caed90b5a96846cae86e3587 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Thu, 24 Sep 2020 09:58:26 +0200 Subject: [PATCH 34/39] update: notification0.7 --- src/dependencies.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dependencies.pug b/src/dependencies.pug index 3e44caf..169589a 100644 --- a/src/dependencies.pug +++ b/src/dependencies.pug @@ -11,7 +11,7 @@ script(type="module" src="https://unpkg.com/@startinblox/oidc@0.10" defer) script(type="module" src="https://unpkg.com/@startinblox/router@0.9" defer) //- script(type="module" src="/lib/sib-router/src/index.js" defer) -//- script(type="module" src="https://unpkg.com/@startinblox/component-notifications@beta" defer) +script(type="module" src="https://unpkg.com/@startinblox/component-notifications@0.7" defer) //- script(type="module" src="/lib/sib-notifications/index.js" defer) if endpoints.events || (endpoints.get && endpoints.get.events) From 7e819938da10d64db1a953521ae085053487fd9f Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Thu, 24 Sep 2020 11:38:57 +0200 Subject: [PATCH 35/39] fix: style on members list --- src/styles/base/user-thumb.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/styles/base/user-thumb.scss b/src/styles/base/user-thumb.scss index c29e8d8..4b6f874 100644 --- a/src/styles/base/user-thumb.scss +++ b/src/styles/base/user-thumb.scss @@ -92,11 +92,16 @@ margin-right: 0.50rem; } } +.user-thumb[name="classGroup"] { + display: block; + margin-top: 15px; +} /* Apply the grids to all user-thumbs */ .user-thumb>div, .user-thumb>[name='classGrid'], [name='user-thumb'] { + @extend %user-thumb__grid; >[name='sup'] { From da10ca455072a5561619681caf42da39ed8efdb5 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Thu, 24 Sep 2020 12:56:19 +0200 Subject: [PATCH 36/39] update: add required --- src/header.pug | 4 +-- src/views/admin/page-admin-circles-create.pug | 3 +++ .../admin/page-admin-projects-create.pug | 4 +++ src/views/admin/page-admin-users-create.pug | 4 +++ src/views/admin/page-admin-users-edit.pug | 3 +++ src/views/circle/page-circle-edit.pug | 4 +++ src/views/job-offer/page-job-offer-create.pug | 26 ------------------- src/views/job-offer/page-job-offer-edit.pug | 26 ------------------- .../message-circle.pug} | 0 .../message-private.pug} | 0 src/views/project/page-project-edit.pug | 2 ++ 11 files changed, 22 insertions(+), 54 deletions(-) delete mode 100644 src/views/job-offer/page-job-offer-create.pug delete mode 100644 src/views/job-offer/page-job-offer-edit.pug rename src/views/{circle/page-circle-notifications.pug => notifications/message-circle.pug} (100%) rename src/views/{user/page-user-notifications.pug => notifications/message-private.pug} (100%) diff --git a/src/header.pug b/src/header.pug index 1320e54..3de936b 100644 --- a/src/header.pug +++ b/src/header.pug @@ -8,8 +8,8 @@ solid-notifications.notLoggedIn( ) //- Templates for notifications from circles and from other users -include views/circle/page-circle-notifications.pug -include views/user/page-user-notifications.pug +include views/notifications/message-circle.pug +include views/notifications/message-private.pug include templates/hubl-user-avatar.pug diff --git a/src/views/admin/page-admin-circles-create.pug b/src/views/admin/page-admin-circles-create.pug index 4ce3474..fcf1334 100644 --- a/src/views/admin/page-admin-circles-create.pug +++ b/src/views/admin/page-admin-circles-create.pug @@ -13,6 +13,9 @@ div.content-box__info.flex data-src=`${endpoints.circles || endpoints.post.circles}` fields='status, name, description' + required-status + required-name + required-description loader-id='loader-circles-create' class-status='form-label is-light is-full-width color' diff --git a/src/views/admin/page-admin-projects-create.pug b/src/views/admin/page-admin-projects-create.pug index aba7209..202131b 100644 --- a/src/views/admin/page-admin-projects-create.pug +++ b/src/views/admin/page-admin-projects-create.pug @@ -24,6 +24,10 @@ div.content-box__info.flex data-src=`${endpoints.projects || endpoints.post.projects}` fields='status, line-1(customer.name, name), line-2(captain)' + required-status + required-customer.name + required-name + required-captain loader-id='loader-projects-create' label-status='Statut du cercle*' diff --git a/src/views/admin/page-admin-users-create.pug b/src/views/admin/page-admin-users-create.pug index 03b4661..f98c5f9 100644 --- a/src/views/admin/page-admin-users-create.pug +++ b/src/views/admin/page-admin-users-create.pug @@ -13,6 +13,10 @@ div.content-box__info.flex data-src=`${endpoints.users || endpoints.post.users}` fields='line-1(first_name, last_name), line-2(username, email), line-3(password)' + required-first_name + required-last_name + required-username + required-email loader-id='loader-users-create' class-first_name='form-label is-light is-half-width input-text-like' diff --git a/src/views/admin/page-admin-users-edit.pug b/src/views/admin/page-admin-users-edit.pug index 13a9e9a..af39318 100644 --- a/src/views/admin/page-admin-users-edit.pug +++ b/src/views/admin/page-admin-users-edit.pug @@ -20,6 +20,9 @@ div.content-box__info.flex bind-resources='' fields='line-1(first_name, last_name), line-2(email)' + required-first_name + required-last_name + required-email loader-id='loader-users-edit' class-first_name='form-label is-light is-half-width input-text-like' diff --git a/src/views/circle/page-circle-edit.pug b/src/views/circle/page-circle-edit.pug index b222af2..3e7c5e5 100644 --- a/src/views/circle/page-circle-edit.pug +++ b/src/views/circle/page-circle-edit.pug @@ -26,6 +26,10 @@ div.content-box__info bind-resources fields='status, line-1(name, owner), description' + required-status + required-name + required-owner + required-description range-owner=`${endpoints.users || endpoints.get.users}` label-status='Statut du cercle' diff --git a/src/views/job-offer/page-job-offer-create.pug b/src/views/job-offer/page-job-offer-create.pug deleted file mode 100644 index d3d0c52..0000000 --- a/src/views/job-offer/page-job-offer-create.pug +++ /dev/null @@ -1,26 +0,0 @@ -.content-box.with-padding.with-form - h1 Post a new job offer - - solid-form( - data-src=`${endpoints.joboffers || endpoints.post.joboffers}` - range-skills=`${endpoints.skills || endpoints.get.skills}` - - fields='title, description, skills, closingDate' - - class-title='field form-label is-light is-expanded' - label-title='Title*' - - class-description='field form-label is-light is-expanded' - label-description='Description*' - widget-description='solid-form-textarea-label' - - class-skills='form-label is-dark select-skills' - label-skills='The required skills for this mission:*' - multiple-skills='solid-form-multipleselect-autocompletion-label' - - class-closingDate='form-label is-dark' - label-closingDate='Publication end date:*' - widget-closingDate='solid-form-date' - - next='job-offers' - ) diff --git a/src/views/job-offer/page-job-offer-edit.pug b/src/views/job-offer/page-job-offer-edit.pug deleted file mode 100644 index e870c3f..0000000 --- a/src/views/job-offer/page-job-offer-edit.pug +++ /dev/null @@ -1,26 +0,0 @@ -.content-box.with-padding.with-form - h1 Edit your job offer - - solid-form( - bind-resources - range-skills=`${endpoints.skills || endpoints.get.skills}` - - fields='title, description, skills, closingDate' - - class-title='field form-label is-light is-expanded' - label-title='Title*' - - class-description='field form-label is-light is-expanded' - label-description='Description*' - widget-description='solid-form-textarea-label' - - class-skills='form-label is-dark select-skills' - label-skills='The required skills for this mission:*' - multiple-skills='solid-form-multipleselect-autocompletion-label' - - class-closingDate='form-label is-dark' - label-closingDate='Publication end date:*' - widget-closingDate='solid-form-date' - - next='job-offers' - ) diff --git a/src/views/circle/page-circle-notifications.pug b/src/views/notifications/message-circle.pug similarity index 100% rename from src/views/circle/page-circle-notifications.pug rename to src/views/notifications/message-circle.pug diff --git a/src/views/user/page-user-notifications.pug b/src/views/notifications/message-private.pug similarity index 100% rename from src/views/user/page-user-notifications.pug rename to src/views/notifications/message-private.pug diff --git a/src/views/project/page-project-edit.pug b/src/views/project/page-project-edit.pug index 16e249d..e054570 100644 --- a/src/views/project/page-project-edit.pug +++ b/src/views/project/page-project-edit.pug @@ -26,6 +26,8 @@ div.content-box__info bind-resources fields='line-1(customer.name, name)' + required-customer.name + required-name label-name='Nom du projet*' From 363588442d0fae9fa56a7c9595f5ccd1c0816aa3 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Thu, 24 Sep 2020 16:35:25 +0200 Subject: [PATCH 37/39] update: handle websocket url --- src/page-messages.pug | 2 +- src/views/circle/page-circle-chat.pug | 2 +- src/views/project/page-project-chat.pug | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/page-messages.pug b/src/page-messages.pug index 21f7c6d..7487d67 100644 --- a/src/page-messages.pug +++ b/src/page-messages.pug @@ -17,7 +17,7 @@ solid-xmpp-chat( data-authentication='login', data-auto-login='true', - data-bosh-service-url=`${xmpp}`, + data-websocket-url=`${xmppWebsocket || 'wss://jabber.happy-dev.fr/xmpp-websocket'}`, data-i18n='en', bind-resources ) diff --git a/src/views/circle/page-circle-chat.pug b/src/views/circle/page-circle-chat.pug index baee3eb..6431898 100644 --- a/src/views/circle/page-circle-chat.pug +++ b/src/views/circle/page-circle-chat.pug @@ -2,7 +2,7 @@ solid-xmpp-chat( data-authentication='login', data-auto-login='true', - data-bosh-service-url=`${xmpp}`, + data-websocket-url=`${xmppWebsocket || 'wss://jabber.happy-dev.fr/xmpp-websocket'}`, data-i18n='en', bind-resources ) \ No newline at end of file diff --git a/src/views/project/page-project-chat.pug b/src/views/project/page-project-chat.pug index add91ab..01a10e6 100644 --- a/src/views/project/page-project-chat.pug +++ b/src/views/project/page-project-chat.pug @@ -2,7 +2,7 @@ solid-xmpp-chat( data-authentication='login', data-auto-login='true', - data-bosh-service-url=`${xmpp}`, + data-websocket-url=`${xmppWebsocket || 'wss://jabber.happy-dev.fr/xmpp-websocket'}`, data-i18n='en', bind-resources ) From 20013352d488a13545fe3a3ec56a4b13513a9e9a Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Thu, 24 Sep 2020 17:18:46 +0200 Subject: [PATCH 38/39] fix: hide data-id='error' --- src/styles/base/form.scss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/styles/base/form.scss b/src/styles/base/form.scss index cf3908a..e5f0f12 100644 --- a/src/styles/base/form.scss +++ b/src/styles/base/form.scss @@ -1,3 +1,9 @@ +solid-form { + [data-id="error"] { + display: none !important; // Hide the default core message, english only with a weird message + } +} + .form form { display: block; height: fit-content; From 1692b42e8f44266e86f3ecabd5508842ecc53ff5 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier Date: Thu, 24 Sep 2020 17:32:52 +0200 Subject: [PATCH 39/39] update: bump job board to @0.8 --- src/dependencies.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dependencies.pug b/src/dependencies.pug index 169589a..562b7ef 100644 --- a/src/dependencies.pug +++ b/src/dependencies.pug @@ -19,7 +19,7 @@ if endpoints.events || (endpoints.get && endpoints.get.events) //- script(type="module" src="/lib/sib-event/sib-event.js" defer) if endpoints.joboffers || (endpoints.get && endpoints.get.joboffers) - script(type="module" src="https://unpkg.com/@startinblox/component-job-board@0.7" defer) + script(type="module" src="https://unpkg.com/@startinblox/component-job-board@0.8" defer) //- script(type="module" src="/lib/solid-job-board/dist/index.js" defer) if (endpoints.uploads || (endpoints.get && endpoints.get.uploads)) && (endpoints.skills || (endpoints.get && endpoints.get.skills)) && (endpoints.users || (endpoints.get && endpoints.get.users))