Added more cucumber tests (wip)
This commit is contained in:
parent
fb3511b264
commit
236d06308d
6 changed files with 69 additions and 11 deletions
|
|
@ -7,7 +7,6 @@ Feature: Allow users to login and logout
|
||||||
Background:
|
Background:
|
||||||
Given I am on the home page
|
Given I am on the home page
|
||||||
|
|
||||||
@watch
|
|
||||||
Scenario: A user can login
|
Scenario: A user can login
|
||||||
Given I have an account and I logged in
|
Given I have an account and I logged in
|
||||||
When I sign out
|
When I sign out
|
||||||
|
|
@ -15,14 +14,12 @@ Feature: Allow users to login and logout
|
||||||
Then I should be logged in
|
Then I should be logged in
|
||||||
And I can edit my profile
|
And I can edit my profile
|
||||||
|
|
||||||
@watch
|
|
||||||
Scenario: A user cannot login with bad information
|
Scenario: A user cannot login with bad information
|
||||||
Given I have an account and I logged in
|
Given I have an account and I logged in
|
||||||
When I sign out
|
When I sign out
|
||||||
When I enter incorrect authentication information
|
When I enter incorrect authentication information
|
||||||
Then I should see a user not found error
|
Then I should see a user not found error
|
||||||
|
|
||||||
@watch
|
|
||||||
Scenario: A user can register and login
|
Scenario: A user can register and login
|
||||||
Given I register with some name, password and email
|
Given I register with some name, password and email
|
||||||
Then I should be registered
|
Then I should be registered
|
||||||
|
|
@ -32,7 +29,6 @@ Feature: Allow users to login and logout
|
||||||
Then I should be logged in
|
Then I should be logged in
|
||||||
And I can edit my profile
|
And I can edit my profile
|
||||||
|
|
||||||
@skip
|
|
||||||
Scenario: A user cannot register without accepting service conditions
|
Scenario: A user cannot register without accepting service conditions
|
||||||
Given I register with some name, password and email but without accept conditions
|
Given I register with some name, password and email but without accept conditions
|
||||||
Then I shouldn't be registered
|
Then I shouldn't be registered
|
||||||
|
|
|
||||||
17
cucumber/features/pages.feature
Normal file
17
cucumber/features/pages.feature
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
@watch
|
||||||
|
Feature: Test all secundary pages
|
||||||
|
|
||||||
|
Scenario: Check that all secondary pages work well
|
||||||
|
Given a list of page ids and contents
|
||||||
|
| license | License |
|
||||||
|
| tos | Terms of Service |
|
||||||
|
| credits | Credits |
|
||||||
|
| privacy | Privacy Policy |
|
||||||
|
| activeFires | Active Fires |
|
||||||
|
Then I check that all pages works properly
|
||||||
|
|
||||||
|
Scenario: Check that other non visible pages work well
|
||||||
|
Given a list of non visible pages ids and contents
|
||||||
|
| status | Status |
|
||||||
|
| error | Upps |
|
||||||
|
Then I check that all non visible pages works properly
|
||||||
|
|
@ -5,13 +5,14 @@
|
||||||
this.Before(() => {
|
this.Before(() => {
|
||||||
// global.expect = require('@xolvio/jasmine-expect').expect;
|
// global.expect = require('@xolvio/jasmine-expect').expect;
|
||||||
|
|
||||||
|
/* Not used
|
||||||
if (!this.initMyCmds) {
|
if (!this.initMyCmds) {
|
||||||
client.addCommand('waitForClickable', function elementClickable(selector, timeout) {
|
client.addCommand('waitForClickable', function elementClickable(selector, timeout) {
|
||||||
this.waitForVisible(selector, timeout);
|
this.waitForVisible(selector, timeout);
|
||||||
this.waitForEnabled(selector, timeout);
|
this.waitForEnabled(selector, timeout);
|
||||||
});
|
});
|
||||||
this.initMyCmds = true;
|
this.initMyCmds = true;
|
||||||
}
|
} */
|
||||||
|
|
||||||
// server.call('fixtures/reset');
|
// server.call('fixtures/reset');
|
||||||
// server.call('emailStub/reset');
|
// server.call('emailStub/reset');
|
||||||
|
|
|
||||||
43
cucumber/features/steps_definitions/pages.js
Normal file
43
cucumber/features/steps_definitions/pages.js
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
/* global module expect require process client */
|
||||||
|
|
||||||
|
const { goHome } = require('./helper.js');
|
||||||
|
|
||||||
|
// Does no works with arrow func
|
||||||
|
module.exports = function () {
|
||||||
|
let pages;
|
||||||
|
|
||||||
|
this.Given(/^a list of page ids and contents$/, (table, callback) => {
|
||||||
|
pages = table.raw();
|
||||||
|
callback();
|
||||||
|
});
|
||||||
|
|
||||||
|
function processPage(i) {
|
||||||
|
const id = `#${pages[i][0]}`;
|
||||||
|
const content = pages[i][1];
|
||||||
|
client.waitForVisible(id, 10000);
|
||||||
|
client.click(id);
|
||||||
|
client.waitForText('#react-root', content);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.Given(/^a list of non visible pages ids and contents$/, (table, callback) => {
|
||||||
|
pages = table.raw();
|
||||||
|
callback();
|
||||||
|
});
|
||||||
|
|
||||||
|
this.Then(/^I check that all non visible pages works properly$/, (callback) => {
|
||||||
|
for (let i = 0; i < pages.length; i += 1) {
|
||||||
|
client.url(`${process.env.ROOT_URL}/${pages[i][0]}`);
|
||||||
|
const content = pages[i][1];
|
||||||
|
client.waitForText('#react-root', content);
|
||||||
|
}
|
||||||
|
callback();
|
||||||
|
});
|
||||||
|
|
||||||
|
this.Then(/^I check that all pages works properly$/, (callback) => {
|
||||||
|
goHome(client);
|
||||||
|
for (let i = 0; i < pages.length; i += 1) {
|
||||||
|
processPage(i);
|
||||||
|
}
|
||||||
|
callback();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
@ -1,8 +1,11 @@
|
||||||
|
/* eslint-disable import/no-absolute-path */
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { year } from '@cleverbeagle/dates';
|
import { year } from '@cleverbeagle/dates';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { Grid } from 'react-bootstrap';
|
import { Grid } from 'react-bootstrap';
|
||||||
import { translate } from 'react-i18next';
|
import { translate } from 'react-i18next';
|
||||||
|
import { testId } from '/imports/ui/components/Utils/TestUtils';
|
||||||
|
|
||||||
import './Footer.scss';
|
import './Footer.scss';
|
||||||
|
|
||||||
|
|
@ -21,19 +24,19 @@ const Footer = (props) => {
|
||||||
|
|
||||||
<ul className="pull-right">
|
<ul className="pull-right">
|
||||||
<li>
|
<li>
|
||||||
<Link to="/terms">
|
<Link id={testId('tos')} to="/terms">
|
||||||
<span className="d-none d-md-inline">{t('Términos de Servicio')}</span>
|
<span className="d-none d-md-inline">{t('Términos de Servicio')}</span>
|
||||||
<span className="d-md-none">{t('Términos')}</span>
|
<span className="d-md-none">{t('Términos')}</span>
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<Link to="/privacy">
|
<Link id={testId('privacy')} to="/privacy">
|
||||||
<span className="d-none d-md-inline">{t('Política de Privacidad')}</span>
|
<span className="d-none d-md-inline">{t('Política de Privacidad')}</span>
|
||||||
<span className="d-md-none">{t('Privacidad')}</span>
|
<span className="d-md-none">{t('Privacidad')}</span>
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li><span className="d-none d-md-inline"><Link to="/license">{t('Licencia')}</Link></span></li>
|
<li><span className="d-none d-md-inline"><Link id={testId('license')} to="/license">{t('Licencia')}</Link></span></li>
|
||||||
<li><span className="d-none d-md-inline"><Link to="/credits">{t('Créditos')}</Link></span></li>
|
<li><span className="d-none d-md-inline"><Link id={testId('credits')} to="/credits">{t('Créditos')}</Link></span></li>
|
||||||
</ul>
|
</ul>
|
||||||
</Grid>
|
</Grid>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
# Licencia
|
|
||||||
|
|
||||||
## Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
|
## Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
|
||||||
|
|
||||||
Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible.
|
Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue