optimised a few test and prepare some feed for reader tests.
This commit is contained in:
parent
bb819b15b5
commit
d5e7b71d62
@ -0,0 +1,14 @@
|
||||
{
|
||||
"xkcd" : {
|
||||
"rss" : "https://xkcd.com/rss.xml",
|
||||
"website" : "https://xkcd.com/",
|
||||
},
|
||||
"css-tricks" : {
|
||||
"rss" : "https://css-tricks.com/feed/?post_type=newsletters",
|
||||
"website" : "https://css-tricks.com/"
|
||||
},
|
||||
"bbcnews" : {
|
||||
"rss" : "http://feeds.bbci.co.uk/news/rss.xml",
|
||||
"website" : "https://www.bbc.com/news"
|
||||
}
|
||||
}
|
@ -49,14 +49,16 @@ describe('As a visitor, I can only register the right way.', function () {
|
||||
it('Prevent to create an account with empty fields', function () {
|
||||
// Arrange
|
||||
cy.get('.menu-reg').first().find('a[href$="action=register"]').click();
|
||||
// Assert everything is fine before acting
|
||||
cy.get('input#register-email').should('have.not.class', 'input_error');
|
||||
cy.get('input#register-password').should('have.not.class', 'input_error');
|
||||
cy.get('div#register-error').should("not.be.visible");
|
||||
// Act
|
||||
cy.get('#register-form').find(":submit").click();
|
||||
// Assert
|
||||
cy.get('div#register-error') // Message d'erreur
|
||||
.should('have.class', 'register__error')
|
||||
.and('be.not.visible');
|
||||
.and('be.visible');
|
||||
cy.get('input#register-email').should('have.class', 'input_error'); // Champs surlignés
|
||||
cy.get('input#register-password').should('have.class', 'input_error');
|
||||
})
|
||||
@ -85,7 +87,7 @@ describe('As a visitor, I can only register the right way.', function () {
|
||||
});
|
||||
})
|
||||
|
||||
it.only('Check that it explain correclty to the user when he try to create an already existing account', function () {
|
||||
it('Check that it explain correclty to the user when he try to create an already existing account', function () {
|
||||
cy.server();
|
||||
cy.fixture("users.json").as("users").then((users) => {
|
||||
let mutoid = users["Mutoid"];
|
||||
@ -98,6 +100,8 @@ describe('As a visitor, I can only register the right way.', function () {
|
||||
failOnStatusCode: false,
|
||||
qs: { "t": new Date().getTime() }
|
||||
}).then((response) => {
|
||||
cy.log(response);
|
||||
cy.expect(response.status).to.be.eq(400);
|
||||
cy.expect(response.body.status).to.be.eq('error');
|
||||
cy.expect(response.body.errors[0]).to.be.eq('This email is already registered, please choose another one.');
|
||||
});
|
||||
@ -114,9 +118,6 @@ describe("As a user, I can only log in and out the right way", function () {
|
||||
before(function () {
|
||||
cy.fixture("users.json").as("users").then((users) => {
|
||||
mutoid = users["Mutoid"];
|
||||
//expect(mutoid.email).to.exist;
|
||||
//expect(mutoid.password).to.exist;
|
||||
//expect(mutoid.type).eq("user");
|
||||
});
|
||||
})
|
||||
|
||||
@ -189,14 +190,16 @@ describe("As a user, I can only log in and out the right way", function () {
|
||||
// Assert
|
||||
cy.url().should('contain', '/online/#/reader/category/all/')
|
||||
cy.get("div#user").find("a.user__settings").click();
|
||||
cy.logout();
|
||||
cy.getCookie('session').should('exist');
|
||||
});
|
||||
|
||||
it.skip('Logs Mutoid in via API', function () {
|
||||
it('Logs Mutoid in via API', function () {
|
||||
// act
|
||||
cy.login(mutoid);
|
||||
cy.visit("/online");
|
||||
// assert
|
||||
cy.url().should('contain', '/online/#/reader/category/all/')
|
||||
cy.get("div#user").find("a.user__settings").click();
|
||||
cy.getCookie('session').should('exist');
|
||||
});
|
||||
|
||||
@ -204,6 +207,7 @@ describe("As a user, I can only log in and out the right way", function () {
|
||||
// Arrange
|
||||
cy.login(mutoid)
|
||||
cy.visit('/online');
|
||||
cy.getCookie('session').should('exist');
|
||||
// act
|
||||
cy.get("div#user").find("a.user__settings").click();
|
||||
cy.get("div#user-menu").find('.logout').click();
|
||||
|
Loading…
x
Reference in New Issue
Block a user