Install the needed packages
npm i --save-dev nightwatch selenium-server chromedriver
Create a e2e-tests
dir:
mkdir e2e-tests
function isObject(x) { | |
return Object.prototype.toString.call(x) === '[object Object]'; | |
}; | |
function getObjPath(obj, pathArray, busArray) { | |
pathArray = pathArray ? pathArray : []; | |
if (isObject(obj)) { | |
for (key in obj) { | |
if (obj.hasOwnProperty(key)) { | |
if (isObject(obj[key])) { |
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under | |
the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in | |
writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the | |
License. --> | |
<!-- | This is the configuration file for Maven. It can be specified at two levels: | | 1. User Level. This settings.xml file provides configuration for a single user, | and is normally provided in ${user.home}/.m2/settings.xml |
/** | |
* Parse query string. | |
* ?a=b&c=d to {a: b, c: d} | |
* @param {String} (option) queryString | |
* @return {Object} query params | |
*/ | |
getQueryParams: function(queryString) { | |
var query = (queryString || window.location.search).substring(1); // delete ? | |
if (!query) { | |
return false; |
Install the needed packages
npm i --save-dev nightwatch selenium-server chromedriver
Create a e2e-tests
dir:
mkdir e2e-tests
export default (store) => { | |
const | |
{ state, dispatch } | |
= store, | |
itemId | |
= state.route.params.itemId, | |
fetchItems | |
= ids => dispatch('FETCH_ITEMS', { ids }), | |
getFetchedItem | |
= () => Promise.resolve(state.items[itemId]), |
export default { | |
beforeMount | |
} | |
function beforeMount(){ | |
/* | |
This is one of the most important functions for the hacker-news app | |
*/ | |
const | |
vm = this, |
made with esnextbin
var currencyValidator = { | |
format: function (number) { | |
return (Math.trunc(number * 100) / 100).toFixed(2) | |
}, | |
parse: function (newString, oldNumber) { | |
var CleanParse = function (value) { | |
return { value: value } | |
} | |
var CurrencyWarning = function (warning, value) { | |
return { |