Some work with spiderable
This commit is contained in:
parent
fc4155ea49
commit
8809a3e3c8
5 changed files with 42 additions and 9 deletions
|
|
@ -11,4 +11,3 @@ Feature: This app should generate a correct sitemap, etc
|
|||
| fires | Active Fires |
|
||||
| login | Login |
|
||||
| signup | Signup |
|
||||
# And should be spiderables
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ Feature: Test all secundary pages
|
|||
| activeFires | Active Fires |
|
||||
Then I check that all pages works properly
|
||||
|
||||
@watch
|
||||
Scenario: Check that all secondary pages work well
|
||||
Given a list of page urls and contents
|
||||
| login | Login | true |
|
||||
|
|
@ -20,6 +21,7 @@ Feature: Test all secundary pages
|
|||
| fire/inexistent | This page doesn't exist | false |
|
||||
| fire/Fe26.2**1a0361ed0384f741403682e26b4bbc3850bee24e775da13c9782b22365ea895f*r_3gmVad5vzkeyqPpo6UcA*1s5fFz3iDGKTYP2RCvXMshof00QCHf4ErDl9K2dxoX0u-J-t6scyOWG8pGp3ehg_FfEtyR_kYcEKU3rE0jaSlZbD09TIvhiIJeS3C6Uc8YD-rit0XBrgsVKfYSxKzTRoOYiYFJ8JYd298hMtfiASePjS05Z58hhicyCcJYYRlarqDScG3LiVY3lL5y2nfcdIMNuSjCiKOJWuMkxwd9nR1UHMudLl0hEoy56mPdnHpDYtP9IYUlIOk1LlWBxcmHKifbXeqHu94p8j13Kk20dh2R49Hw3KsSoE9UbWmGQA9wAZXT82301i3rGF5GPAKjlTlRYcWisQurnPwHSVmx3DhUdiYwKGxt4KeaM5QVI4BE9octvE41OOprB_-Il105diQEh2Y9vdvX51ZVWIRfCboICPM6rJb0Oin7U7F1iM-oD_5s3DGnelfM5LGBcKwiB5paMo5M5vdBMaO-zR216cW9yGVXw9IZqHx8xDQWnoHAZjt8NLHeiGF2QOmIGtEUH7qnwhGpkcvszajmAZzR8saZgoH1qfBfvpVA41YfV14gU**4d030f05e23ad75409cebc609107467fc60be5077d52cf041087cd024fc4dc45*GY97aGFc1MyAsoO3Qxqtgwk9j-MbAPdEGBmEHq6r8VU | Additional information | false |
|
||||
Then I check that all page urls works properly
|
||||
# And they are spiderable
|
||||
|
||||
Scenario: Check that other non visible pages work well
|
||||
Given a list of non visible pages ids and contents
|
||||
|
|
|
|||
|
|
@ -71,4 +71,13 @@ module.exports = function () {
|
|||
}
|
||||
callback();
|
||||
});
|
||||
|
||||
this.Then(/^they are spiderable$/, (callback) => {
|
||||
// Write code here that turns the phrase above into concrete actions
|
||||
for (let i = 0; i < pages.length; i += 1) {
|
||||
client.url(`${process.env.ROOT_URL}/${pages[i][0]}?_escaped_fragment_=`);
|
||||
client.waitForText('#react-root', pages[i][1]);
|
||||
}
|
||||
callback();
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,12 +1,5 @@
|
|||
import { Meteor } from 'meteor/meteor';
|
||||
import createHistory from 'history/createBrowserHistory';
|
||||
|
||||
const history = createHistory();
|
||||
|
||||
history.listen((location) => { // , action ) => {
|
||||
// console.log(location.pathname);
|
||||
// console.log(action); // PUSH, etc
|
||||
Meteor.Piwik.trackPage(location.pathname);
|
||||
});
|
||||
|
||||
export default history;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/* eslint-disable jsx-a11y/no-href */
|
||||
/* eslint import/no-absolute-path: [2, { esmodule: false, commonjs: false, amd: false }] */
|
||||
|
||||
import React from 'react';
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Router, Switch, Route } from 'react-router-dom';
|
||||
import { Grid } from 'react-bootstrap';
|
||||
|
|
@ -54,11 +54,40 @@ import history from '../../components/History/History';
|
|||
import '../../components/NotificationsObserver/NotificationsObserver';
|
||||
import './App.scss';
|
||||
|
||||
class LocationListener extends Component {
|
||||
// https://stackoverflow.com/questions/43512450/react-router-v4-route-onchange-event
|
||||
static contextTypes = {
|
||||
router: PropTypes.object
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
this.handleLocationChange(this.context.router.history.location);
|
||||
this.unlisten =
|
||||
this.context.router.history.listen(this.handleLocationChange);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.unlisten();
|
||||
}
|
||||
|
||||
handleLocationChange(location) {
|
||||
// your staff here
|
||||
console.log(`----- location: '${location.pathname}'`);
|
||||
Meteor.Piwik.trackPage(location.pathname);
|
||||
// Meteor.isReadyForSpiderable = true;
|
||||
}
|
||||
|
||||
render() {
|
||||
return this.props.children;
|
||||
}
|
||||
}
|
||||
|
||||
const App = props => (
|
||||
/* https://react.i18next.com/components/i18nextprovider.html */
|
||||
<I18nextProvider i18n={i18n}>
|
||||
<ErrorBoundary>
|
||||
<Router history={history}>
|
||||
<LocationListener>
|
||||
{ !props.loading ?
|
||||
<div className="App">
|
||||
<Helmet>
|
||||
|
|
@ -112,6 +141,7 @@ const App = props => (
|
|||
<Blaze template="cookieConsent" />
|
||||
}
|
||||
</div> : ''}
|
||||
</LocationListener>
|
||||
</Router>
|
||||
</ErrorBoundary>
|
||||
</I18nextProvider>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue