#509: Checkstyle Fixes
This commit is contained in:
@ -1,4 +1,28 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--
|
||||||
|
|
||||||
|
The MIT License
|
||||||
|
Copyright (c) 2014 Ilkka Seppälä
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
-->
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
@ -30,6 +54,16 @@
|
|||||||
<version>1.4.6</version>
|
<version>1.4.6</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.junit.jupiter</groupId>
|
||||||
|
<artifactId>junit-jupiter-api</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.junit.jupiter</groupId>
|
||||||
|
<artifactId>junit-jupiter-engine</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
@ -1,12 +1,49 @@
|
|||||||
|
/**
|
||||||
|
* The MIT License
|
||||||
|
* Copyright (c) 2014 Ilkka Seppälä
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
package com.iluwatar.component.app;
|
package com.iluwatar.component.app;
|
||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Web development is shifting more and more towards reusable components.
|
||||||
|
* Frameworks like React, Polymer, Angular, Ember and others provide various
|
||||||
|
* component friendly abstractions to make front-end code-bases more maintainable.
|
||||||
|
* So our web applications are now full of “widgets” that have same behavior.
|
||||||
|
* We can use component various times on single web page or re-use it on various web pages.
|
||||||
|
* Component Object pattern provides an abstraction which covers functionality of
|
||||||
|
* single component and reuse it across end-to-end tests. When we have various same
|
||||||
|
* components on single web page, we are going to use various Component Objects of
|
||||||
|
* same type per Page Object.
|
||||||
|
*
|
||||||
|
*/
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
public class TodoApp {
|
public class TodoApp {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
/**
|
||||||
SpringApplication.run(TodoApp.class, args);
|
* Program entry point
|
||||||
}
|
*/
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(TodoApp.class, args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
#
|
||||||
|
# The MIT License
|
||||||
|
# Copyright (c) 2014 Ilkka Seppälä
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
# of this software and associated documentation files (the "Software"), to deal
|
||||||
|
# in the Software without restriction, including without limitation the rights
|
||||||
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
# copies of the Software, and to permit persons to whom the Software is
|
||||||
|
# furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included in
|
||||||
|
# all copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
# THE SOFTWARE.
|
||||||
|
#
|
||||||
|
|
||||||
|
@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* The MIT License
|
||||||
|
* Copyright (c) 2014 Ilkka Seppälä
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
/******/ (function(modules) { // webpackBootstrap
|
/******/ (function(modules) { // webpackBootstrap
|
||||||
/******/ // The module cache
|
/******/ // The module cache
|
||||||
/******/ var installedModules = {};
|
/******/ var installedModules = {};
|
||||||
|
@ -1,3 +1,27 @@
|
|||||||
|
<!--
|
||||||
|
|
||||||
|
The MIT License
|
||||||
|
Copyright (c) 2014 Ilkka Seppälä
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
-->
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* The MIT License
|
||||||
|
* Copyright (c) 2014 Ilkka Seppälä
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import webpack from 'webpack';
|
import webpack from 'webpack';
|
||||||
import webpackDevMiddleware from 'webpack-dev-middleware';
|
import webpackDevMiddleware from 'webpack-dev-middleware';
|
||||||
|
@ -1,3 +1,27 @@
|
|||||||
|
<!--
|
||||||
|
|
||||||
|
The MIT License
|
||||||
|
Copyright (c) 2014 Ilkka Seppälä
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
-->
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* The MIT License
|
||||||
|
* Copyright (c) 2014 Ilkka Seppälä
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
let nextTodoId = 0;
|
let nextTodoId = 0;
|
||||||
export const addTodo = (text) => {
|
export const addTodo = (text) => {
|
||||||
return {
|
return {
|
||||||
|
@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* The MIT License
|
||||||
|
* Copyright (c) 2014 Ilkka Seppälä
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
import React, { PropTypes } from 'react';
|
import React, { PropTypes } from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { addGroceryItem } from '../actions';
|
import { addGroceryItem } from '../actions';
|
||||||
|
@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* The MIT License
|
||||||
|
* Copyright (c) 2014 Ilkka Seppälä
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
import React, { PropTypes } from 'react';
|
import React, { PropTypes } from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { addTodo } from '../actions';
|
import { addTodo } from '../actions';
|
||||||
|
@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* The MIT License
|
||||||
|
* Copyright (c) 2014 Ilkka Seppälä
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Footer from './Footer';
|
import Footer from './Footer';
|
||||||
import AddTodo from './AddTodo';
|
import AddTodo from './AddTodo';
|
||||||
|
@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* The MIT License
|
||||||
|
* Copyright (c) 2014 Ilkka Seppälä
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { setVisibilityFilter } from '../actions';
|
import { setVisibilityFilter } from '../actions';
|
||||||
import Link from './Link';
|
import Link from './Link';
|
||||||
|
@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* The MIT License
|
||||||
|
* Copyright (c) 2014 Ilkka Seppälä
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import FilterLink from './FilterLink';
|
import FilterLink from './FilterLink';
|
||||||
|
|
||||||
|
@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* The MIT License
|
||||||
|
* Copyright (c) 2014 Ilkka Seppälä
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
import React, { PropTypes } from 'react';
|
import React, { PropTypes } from 'react';
|
||||||
|
|
||||||
const Link = ({ active, children, onClick }) => {
|
const Link = ({ active, children, onClick }) => {
|
||||||
|
@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* The MIT License
|
||||||
|
* Copyright (c) 2014 Ilkka Seppälä
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
import React, { PropTypes } from 'react';
|
import React, { PropTypes } from 'react';
|
||||||
|
|
||||||
const Todo = ({ onClick, completed, text }) => (
|
const Todo = ({ onClick, completed, text }) => (
|
||||||
|
@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* The MIT License
|
||||||
|
* Copyright (c) 2014 Ilkka Seppälä
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
import React, { PropTypes } from 'react';
|
import React, { PropTypes } from 'react';
|
||||||
import Todo from './Todo';
|
import Todo from './Todo';
|
||||||
|
|
||||||
|
@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* The MIT License
|
||||||
|
* Copyright (c) 2014 Ilkka Seppälä
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { toggleGroceryItem } from '../actions';
|
import { toggleGroceryItem } from '../actions';
|
||||||
import TodoList from './TodoList';
|
import TodoList from './TodoList';
|
||||||
|
@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* The MIT License
|
||||||
|
* Copyright (c) 2014 Ilkka Seppälä
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { toggleTodo } from '../actions';
|
import { toggleTodo } from '../actions';
|
||||||
import TodoList from './TodoList';
|
import TodoList from './TodoList';
|
||||||
|
@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* The MIT License
|
||||||
|
* Copyright (c) 2014 Ilkka Seppälä
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
import 'babel-polyfill';
|
import 'babel-polyfill';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { render } from 'react-dom';
|
import { render } from 'react-dom';
|
||||||
|
@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* The MIT License
|
||||||
|
* Copyright (c) 2014 Ilkka Seppälä
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
const groceryItem = (state, action) => {
|
const groceryItem = (state, action) => {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case 'ADD_GROCERY_ITEM':
|
case 'ADD_GROCERY_ITEM':
|
||||||
|
@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* The MIT License
|
||||||
|
* Copyright (c) 2014 Ilkka Seppälä
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
import { combineReducers } from 'redux';
|
import { combineReducers } from 'redux';
|
||||||
import todos from './todos';
|
import todos from './todos';
|
||||||
import groceryList from './groceryList';
|
import groceryList from './groceryList';
|
||||||
|
@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* The MIT License
|
||||||
|
* Copyright (c) 2014 Ilkka Seppälä
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
const todo = (state, action) => {
|
const todo = (state, action) => {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case 'ADD_TODO':
|
case 'ADD_TODO':
|
||||||
|
@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* The MIT License
|
||||||
|
* Copyright (c) 2014 Ilkka Seppälä
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
const visibilityFilter = (state = 'SHOW_ALL', action) => {
|
const visibilityFilter = (state = 'SHOW_ALL', action) => {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case 'SET_VISIBILITY_FILTER':
|
case 'SET_VISIBILITY_FILTER':
|
||||||
|
@ -1,3 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* The MIT License
|
||||||
|
* Copyright (c) 2014 Ilkka Seppälä
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -1,3 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* The MIT License
|
||||||
|
* Copyright (c) 2014 Ilkka Seppälä
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
package com.iluwatar.component;
|
package com.iluwatar.component;
|
||||||
|
|
||||||
import org.openqa.selenium.By;
|
import org.openqa.selenium.By;
|
||||||
@ -5,19 +27,19 @@ import org.openqa.selenium.WebDriver;
|
|||||||
import org.openqa.selenium.WebElement;
|
import org.openqa.selenium.WebElement;
|
||||||
|
|
||||||
class AddItemComponent {
|
class AddItemComponent {
|
||||||
private WebDriver driver;
|
private WebDriver driver;
|
||||||
private String containerCssSelector;
|
private String containerCssSelector;
|
||||||
|
|
||||||
AddItemComponent(WebDriver driver, String containerCssSelector) {
|
AddItemComponent(WebDriver driver, String containerCssSelector) {
|
||||||
this.driver = driver;
|
this.driver = driver;
|
||||||
this.containerCssSelector = containerCssSelector;
|
this.containerCssSelector = containerCssSelector;
|
||||||
}
|
}
|
||||||
|
|
||||||
AddItemComponent addItem(String todo) {
|
AddItemComponent addItem(String todo) {
|
||||||
WebElement input = driver.findElement(By.cssSelector(containerCssSelector + " input"));
|
WebElement input = driver.findElement(By.cssSelector(containerCssSelector + " input"));
|
||||||
input.sendKeys(todo);
|
input.sendKeys(todo);
|
||||||
WebElement button = driver.findElement(By.cssSelector(containerCssSelector + " button"));
|
WebElement button = driver.findElement(By.cssSelector(containerCssSelector + " button"));
|
||||||
button.click();
|
button.click();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,54 +1,77 @@
|
|||||||
|
/**
|
||||||
|
* The MIT License
|
||||||
|
* Copyright (c) 2014 Ilkka Seppälä
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
package com.iluwatar.component;
|
package com.iluwatar.component;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.openqa.selenium.By;
|
|
||||||
import org.openqa.selenium.WebDriver;
|
|
||||||
import org.openqa.selenium.WebElement;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static java.lang.String.format;
|
import static java.lang.String.format;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.openqa.selenium.By;
|
||||||
|
import org.openqa.selenium.WebDriver;
|
||||||
|
import org.openqa.selenium.WebElement;
|
||||||
|
|
||||||
class ItemsListComponent {
|
class ItemsListComponent {
|
||||||
private final WebDriver driver;
|
private final WebDriver driver;
|
||||||
private final String containerCssSelector;
|
private final String containerCssSelector;
|
||||||
|
|
||||||
ItemsListComponent(WebDriver driver, String containerCssSelector) {
|
ItemsListComponent(WebDriver driver, String containerCssSelector) {
|
||||||
this.driver = driver;
|
this.driver = driver;
|
||||||
this.containerCssSelector = containerCssSelector;
|
this.containerCssSelector = containerCssSelector;
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemsListComponent clickOnItem(String todoItem) {
|
ItemsListComponent clickOnItem(String todoItem) {
|
||||||
findElementWithText(todoItem).click();
|
findElementWithText(todoItem).click();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemsListComponent verifyItemShown(String todoItem, boolean expectedStrikethrough) {
|
ItemsListComponent verifyItemShown(String todoItem, boolean expectedStrikethrough) {
|
||||||
WebElement todoElement = findElementWithText(todoItem);
|
WebElement todoElement = findElementWithText(todoItem);
|
||||||
assertNotNull(todoElement);
|
assertNotNull(todoElement);
|
||||||
boolean actualStrikethrough = todoElement.getAttribute("style").contains("text-decoration: line-through;");
|
boolean actualStrikethrough = todoElement.getAttribute("style")
|
||||||
assertEquals(expectedStrikethrough, actualStrikethrough);
|
.contains("text-decoration: line-through;");
|
||||||
return this;
|
assertEquals(expectedStrikethrough, actualStrikethrough);
|
||||||
}
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
ItemsListComponent verifyItemNotShown(String todoItem) {
|
ItemsListComponent verifyItemNotShown(String todoItem) {
|
||||||
assertTrue(findElementsWithText(todoItem).isEmpty());
|
assertTrue(findElementsWithText(todoItem).isEmpty());
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
private WebElement findElementWithText(String text) {
|
private WebElement findElementWithText(String text) {
|
||||||
return driver.findElement(getConditionForText(text));
|
return driver.findElement(getConditionForText(text));
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<WebElement> findElementsWithText(String text) {
|
private List<WebElement> findElementsWithText(String text) {
|
||||||
return driver.findElements(getConditionForText(text));
|
return driver.findElements(getConditionForText(text));
|
||||||
}
|
}
|
||||||
|
|
||||||
private By getConditionForText(String text) {
|
private By getConditionForText(String text) {
|
||||||
String containerClassName = StringUtils.substring(containerCssSelector, 1);
|
String containerClassName = StringUtils.substring(containerCssSelector, 1);
|
||||||
return By.xpath(format("//*[@class='" + containerClassName + "']//*[text()='%s']", text));
|
return By.xpath(format("//*[@class='" + containerClassName + "']//*[text()='%s']", text));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,29 @@
|
|||||||
|
/**
|
||||||
|
* The MIT License
|
||||||
|
* Copyright (c) 2014 Ilkka Seppälä
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
package com.iluwatar.component;
|
package com.iluwatar.component;
|
||||||
|
|
||||||
|
import com.iluwatar.component.app.TodoApp;
|
||||||
|
|
||||||
import io.github.bonigarcia.wdm.ChromeDriverManager;
|
import io.github.bonigarcia.wdm.ChromeDriverManager;
|
||||||
|
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
@ -12,243 +36,244 @@ import org.springframework.boot.test.SpringApplicationConfiguration;
|
|||||||
import org.springframework.boot.test.WebIntegrationTest;
|
import org.springframework.boot.test.WebIntegrationTest;
|
||||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||||
|
|
||||||
import com.iluwatar.component.app.TodoApp;
|
/**
|
||||||
|
* Tests various components.
|
||||||
|
*/
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
@RunWith(SpringJUnit4ClassRunner.class)
|
||||||
@SpringApplicationConfiguration(classes = TodoApp.class)
|
@SpringApplicationConfiguration(classes = TodoApp.class)
|
||||||
@WebIntegrationTest
|
@WebIntegrationTest
|
||||||
public class TodoAppTest {
|
public class TodoAppTest {
|
||||||
private static WebDriver driver;
|
private static WebDriver driver;
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void setUp() {
|
public static void setUp() {
|
||||||
ChromeDriverManager.getInstance().setup();
|
ChromeDriverManager.getInstance().setup();
|
||||||
driver = new ChromeDriver();
|
driver = new ChromeDriver();
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterClass
|
@AfterClass
|
||||||
public static void tearDown() {
|
public static void tearDown() {
|
||||||
driver.quit();
|
driver.quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCreateTodos() {
|
public void testCreateTodos() {
|
||||||
// GIVEN
|
// GIVEN
|
||||||
new TodoPageObject(driver).get()
|
new TodoPageObject(driver).get()
|
||||||
|
|
||||||
// WHEN
|
// WHEN
|
||||||
.addTodo("Buy groceries")
|
.addTodo("Buy groceries")
|
||||||
.addTodo("Tidy up")
|
.addTodo("Tidy up")
|
||||||
|
|
||||||
// THEN
|
// THEN
|
||||||
.getTodoList()
|
.getTodoList()
|
||||||
.verifyItemShown("Buy groceries", false)
|
.verifyItemShown("Buy groceries", false)
|
||||||
.verifyItemShown("Tidy up", false);
|
.verifyItemShown("Tidy up", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCompleteTodo() {
|
public void testCompleteTodo() {
|
||||||
// GIVEN
|
// GIVEN
|
||||||
new TodoPageObject(driver).get()
|
new TodoPageObject(driver).get()
|
||||||
.addTodo("Buy groceries")
|
.addTodo("Buy groceries")
|
||||||
.addTodo("Tidy up")
|
.addTodo("Tidy up")
|
||||||
.getTodoList()
|
.getTodoList()
|
||||||
|
|
||||||
// WHEN
|
// WHEN
|
||||||
.clickOnItem("Buy groceries")
|
.clickOnItem("Buy groceries")
|
||||||
|
|
||||||
// THEN
|
// THEN
|
||||||
.verifyItemShown("Buy groceries", true)
|
.verifyItemShown("Buy groceries", true)
|
||||||
.verifyItemShown("Tidy up", false);
|
.verifyItemShown("Tidy up", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSelectTodosActive() {
|
public void testSelectTodosActive() {
|
||||||
// GIVEN
|
// GIVEN
|
||||||
TodoPageObject todoPage = new TodoPageObject(driver).get();
|
TodoPageObject todoPage = new TodoPageObject(driver).get();
|
||||||
|
|
||||||
todoPage
|
todoPage
|
||||||
.addTodo("Buy groceries")
|
.addTodo("Buy groceries")
|
||||||
.addTodo("Tidy up")
|
.addTodo("Tidy up")
|
||||||
.getTodoList()
|
.getTodoList()
|
||||||
.clickOnItem("Buy groceries");
|
.clickOnItem("Buy groceries");
|
||||||
|
|
||||||
// WHEN
|
// WHEN
|
||||||
todoPage
|
todoPage
|
||||||
.selectActive()
|
.selectActive()
|
||||||
|
|
||||||
// THEN
|
// THEN
|
||||||
.getTodoList()
|
.getTodoList()
|
||||||
.verifyItemNotShown("Buy groceries")
|
.verifyItemNotShown("Buy groceries")
|
||||||
.verifyItemShown("Tidy up", false);
|
.verifyItemShown("Tidy up", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSelectTodosCompleted() {
|
public void testSelectTodosCompleted() {
|
||||||
// GIVEN
|
// GIVEN
|
||||||
TodoPageObject todoPage = new TodoPageObject(driver).get();
|
TodoPageObject todoPage = new TodoPageObject(driver).get();
|
||||||
todoPage
|
todoPage
|
||||||
.addTodo("Buy groceries")
|
.addTodo("Buy groceries")
|
||||||
.addTodo("Tidy up")
|
.addTodo("Tidy up")
|
||||||
.getTodoList()
|
.getTodoList()
|
||||||
.clickOnItem("Buy groceries");
|
.clickOnItem("Buy groceries");
|
||||||
|
|
||||||
// WHEN
|
// WHEN
|
||||||
todoPage
|
todoPage
|
||||||
.selectCompleted()
|
.selectCompleted()
|
||||||
|
|
||||||
// THEN
|
// THEN
|
||||||
.getTodoList()
|
.getTodoList()
|
||||||
.verifyItemShown("Buy groceries", true)
|
.verifyItemShown("Buy groceries", true)
|
||||||
.verifyItemNotShown("Tidy up");
|
.verifyItemNotShown("Tidy up");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSelectTodosAll() {
|
public void testSelectTodosAll() {
|
||||||
// GIVEN
|
// GIVEN
|
||||||
TodoPageObject todoPage = new TodoPageObject(driver).get();
|
TodoPageObject todoPage = new TodoPageObject(driver).get();
|
||||||
todoPage
|
todoPage
|
||||||
.addTodo("Buy groceries")
|
.addTodo("Buy groceries")
|
||||||
.addTodo("Tidy up")
|
.addTodo("Tidy up")
|
||||||
.getTodoList()
|
.getTodoList()
|
||||||
.clickOnItem("Buy groceries");
|
.clickOnItem("Buy groceries");
|
||||||
todoPage
|
todoPage
|
||||||
.selectCompleted()
|
.selectCompleted()
|
||||||
|
|
||||||
// WHEN
|
// WHEN
|
||||||
.selectAll()
|
.selectAll()
|
||||||
|
|
||||||
// THEN
|
// THEN
|
||||||
.getTodoList()
|
.getTodoList()
|
||||||
.verifyItemShown("Buy groceries", true)
|
.verifyItemShown("Buy groceries", true)
|
||||||
.verifyItemShown("Tidy up", false);
|
.verifyItemShown("Tidy up", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCreateGroceryItems() {
|
public void testCreateGroceryItems() {
|
||||||
// GIVEN
|
// GIVEN
|
||||||
new TodoPageObject(driver).get()
|
new TodoPageObject(driver).get()
|
||||||
|
|
||||||
// WHEN
|
// WHEN
|
||||||
.addGroceryItem("avocados")
|
.addGroceryItem("avocados")
|
||||||
.addGroceryItem("tomatoes")
|
.addGroceryItem("tomatoes")
|
||||||
|
|
||||||
// THEN
|
// THEN
|
||||||
.getGroceryList()
|
.getGroceryList()
|
||||||
.verifyItemShown("avocados", false)
|
.verifyItemShown("avocados", false)
|
||||||
.verifyItemShown("tomatoes", false);
|
.verifyItemShown("tomatoes", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCompleteGroceryItem() {
|
public void testCompleteGroceryItem() {
|
||||||
// GIVEN
|
// GIVEN
|
||||||
new TodoPageObject(driver).get()
|
new TodoPageObject(driver).get()
|
||||||
.addGroceryItem("avocados")
|
.addGroceryItem("avocados")
|
||||||
.addGroceryItem("tomatoes")
|
.addGroceryItem("tomatoes")
|
||||||
.getGroceryList()
|
.getGroceryList()
|
||||||
|
|
||||||
// WHEN
|
// WHEN
|
||||||
.clickOnItem("avocados")
|
.clickOnItem("avocados")
|
||||||
|
|
||||||
// THEN
|
// THEN
|
||||||
.verifyItemShown("avocados", true)
|
.verifyItemShown("avocados", true)
|
||||||
.verifyItemShown("tomatoes", false);
|
.verifyItemShown("tomatoes", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSelectGroceryItemsActive() {
|
public void testSelectGroceryItemsActive() {
|
||||||
// GIVEN
|
// GIVEN
|
||||||
TodoPageObject todoPage = new TodoPageObject(driver).get();
|
TodoPageObject todoPage = new TodoPageObject(driver).get();
|
||||||
|
|
||||||
todoPage
|
todoPage
|
||||||
.addGroceryItem("avocados")
|
.addGroceryItem("avocados")
|
||||||
.addGroceryItem("tomatoes")
|
.addGroceryItem("tomatoes")
|
||||||
.getGroceryList()
|
.getGroceryList()
|
||||||
.clickOnItem("avocados");
|
.clickOnItem("avocados");
|
||||||
|
|
||||||
// WHEN
|
// WHEN
|
||||||
todoPage
|
todoPage
|
||||||
.selectActive()
|
.selectActive()
|
||||||
|
|
||||||
// THEN
|
// THEN
|
||||||
.getGroceryList()
|
.getGroceryList()
|
||||||
.verifyItemNotShown("avocados")
|
.verifyItemNotShown("avocados")
|
||||||
.verifyItemShown("tomatoes", false);
|
.verifyItemShown("tomatoes", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSelectGroceryItemsCompleted() {
|
public void testSelectGroceryItemsCompleted() {
|
||||||
// GIVEN
|
// GIVEN
|
||||||
TodoPageObject todoPage = new TodoPageObject(driver).get();
|
TodoPageObject todoPage = new TodoPageObject(driver).get();
|
||||||
todoPage
|
todoPage
|
||||||
.addGroceryItem("avocados")
|
.addGroceryItem("avocados")
|
||||||
.addGroceryItem("tomatoes")
|
.addGroceryItem("tomatoes")
|
||||||
.getGroceryList()
|
.getGroceryList()
|
||||||
.clickOnItem("avocados");
|
.clickOnItem("avocados");
|
||||||
|
|
||||||
// WHEN
|
// WHEN
|
||||||
todoPage
|
todoPage
|
||||||
.selectCompleted()
|
.selectCompleted()
|
||||||
|
|
||||||
// THEN
|
// THEN
|
||||||
.getGroceryList()
|
.getGroceryList()
|
||||||
.verifyItemShown("avocados", true)
|
.verifyItemShown("avocados", true)
|
||||||
.verifyItemNotShown("tomatoes");
|
.verifyItemNotShown("tomatoes");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSelectGroceryItemsAll() {
|
public void testSelectGroceryItemsAll() {
|
||||||
// GIVEN
|
// GIVEN
|
||||||
TodoPageObject todoPage = new TodoPageObject(driver).get();
|
TodoPageObject todoPage = new TodoPageObject(driver).get();
|
||||||
todoPage
|
todoPage
|
||||||
.addGroceryItem("avocados")
|
.addGroceryItem("avocados")
|
||||||
.addGroceryItem("tomatoes")
|
.addGroceryItem("tomatoes")
|
||||||
.getGroceryList()
|
.getGroceryList()
|
||||||
.clickOnItem("avocados");
|
.clickOnItem("avocados");
|
||||||
todoPage
|
todoPage
|
||||||
.selectCompleted()
|
.selectCompleted()
|
||||||
|
|
||||||
// WHEN
|
// WHEN
|
||||||
.selectAll()
|
.selectAll()
|
||||||
|
|
||||||
// THEN
|
// THEN
|
||||||
.getGroceryList()
|
.getGroceryList()
|
||||||
.verifyItemShown("avocados", true)
|
.verifyItemShown("avocados", true)
|
||||||
.verifyItemShown("tomatoes", false);
|
.verifyItemShown("tomatoes", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSelectCombinedItemsActive() {
|
public void testSelectCombinedItemsActive() {
|
||||||
// GIVEN
|
// GIVEN
|
||||||
TodoPageObject todoPage = new TodoPageObject(driver).get();
|
TodoPageObject todoPage = new TodoPageObject(driver).get();
|
||||||
|
|
||||||
todoPage
|
todoPage
|
||||||
.addTodo("Buy groceries")
|
.addTodo("Buy groceries")
|
||||||
.addTodo("Tidy up")
|
.addTodo("Tidy up")
|
||||||
.addGroceryItem("avocados")
|
.addGroceryItem("avocados")
|
||||||
.addGroceryItem("tomatoes");
|
.addGroceryItem("tomatoes");
|
||||||
|
|
||||||
todoPage
|
todoPage
|
||||||
.getGroceryList()
|
.getGroceryList()
|
||||||
.clickOnItem("avocados");
|
.clickOnItem("avocados");
|
||||||
|
|
||||||
todoPage
|
todoPage
|
||||||
.getTodoList()
|
.getTodoList()
|
||||||
.clickOnItem("Tidy up");
|
.clickOnItem("Tidy up");
|
||||||
|
|
||||||
// WHEN
|
// WHEN
|
||||||
todoPage
|
todoPage
|
||||||
.selectActive();
|
.selectActive();
|
||||||
|
|
||||||
// THEN
|
// THEN
|
||||||
todoPage
|
todoPage
|
||||||
.getTodoList()
|
.getTodoList()
|
||||||
.verifyItemShown("Buy groceries", false)
|
.verifyItemShown("Buy groceries", false)
|
||||||
.verifyItemNotShown("Tidy up");
|
.verifyItemNotShown("Tidy up");
|
||||||
|
|
||||||
todoPage
|
todoPage
|
||||||
.getGroceryList()
|
.getGroceryList()
|
||||||
.verifyItemNotShown("avocados")
|
.verifyItemNotShown("avocados")
|
||||||
.verifyItemShown("tomatoes", false);
|
.verifyItemShown("tomatoes", false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,79 +1,98 @@
|
|||||||
|
/**
|
||||||
|
* The MIT License
|
||||||
|
* Copyright (c) 2014 Ilkka Seppälä
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
* THE SOFTWARE.
|
||||||
|
*/
|
||||||
package com.iluwatar.component;
|
package com.iluwatar.component;
|
||||||
|
|
||||||
|
import static java.lang.String.format;
|
||||||
|
|
||||||
import org.openqa.selenium.By;
|
import org.openqa.selenium.By;
|
||||||
import org.openqa.selenium.WebDriver;
|
import org.openqa.selenium.WebDriver;
|
||||||
import org.openqa.selenium.WebElement;
|
import org.openqa.selenium.WebElement;
|
||||||
import org.openqa.selenium.support.ui.ExpectedConditions;
|
import org.openqa.selenium.support.ui.ExpectedConditions;
|
||||||
import org.openqa.selenium.support.ui.WebDriverWait;
|
import org.openqa.selenium.support.ui.WebDriverWait;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static java.lang.String.format;
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
class TodoPageObject {
|
class TodoPageObject {
|
||||||
private final WebDriver driver;
|
private final WebDriver driver;
|
||||||
private final WebDriverWait wait;
|
private final WebDriverWait wait;
|
||||||
private final ItemsListComponent todoItemsList;
|
private final ItemsListComponent todoItemsList;
|
||||||
private final AddItemComponent addTodoItemComponent;
|
private final AddItemComponent addTodoItemComponent;
|
||||||
private final ItemsListComponent groceryItemsList;
|
private final ItemsListComponent groceryItemsList;
|
||||||
private final AddItemComponent addGroceryItemComponent;
|
private final AddItemComponent addGroceryItemComponent;
|
||||||
|
|
||||||
TodoPageObject(WebDriver driver) {
|
TodoPageObject(WebDriver driver) {
|
||||||
this.driver = driver;
|
this.driver = driver;
|
||||||
this.wait = new WebDriverWait(driver, 10);
|
this.wait = new WebDriverWait(driver, 10);
|
||||||
todoItemsList = new ItemsListComponent(driver, ".todo-list");
|
todoItemsList = new ItemsListComponent(driver, ".todo-list");
|
||||||
addTodoItemComponent = new AddItemComponent(driver, ".add-todo");
|
addTodoItemComponent = new AddItemComponent(driver, ".add-todo");
|
||||||
groceryItemsList = new ItemsListComponent(driver, ".grocery-list");
|
groceryItemsList = new ItemsListComponent(driver, ".grocery-list");
|
||||||
addGroceryItemComponent = new AddItemComponent(driver, ".add-grocery-item");
|
addGroceryItemComponent = new AddItemComponent(driver, ".add-grocery-item");
|
||||||
}
|
}
|
||||||
|
|
||||||
TodoPageObject get() {
|
TodoPageObject get() {
|
||||||
driver.get("localhost:8080");
|
driver.get("localhost:8080");
|
||||||
wait.until(ExpectedConditions.elementToBeClickable(By.tagName("button")));
|
wait.until(ExpectedConditions.elementToBeClickable(By.tagName("button")));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
TodoPageObject selectAll() {
|
TodoPageObject selectAll() {
|
||||||
findElementWithText("All").click();
|
findElementWithText("All").click();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
TodoPageObject selectActive() {
|
TodoPageObject selectActive() {
|
||||||
findElementWithText("Active").click();
|
findElementWithText("Active").click();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
TodoPageObject selectCompleted() {
|
TodoPageObject selectCompleted() {
|
||||||
findElementWithText("Completed").click();
|
findElementWithText("Completed").click();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
TodoPageObject addTodo(String todoName) {
|
TodoPageObject addTodo(String todoName) {
|
||||||
addTodoItemComponent.addItem(todoName);
|
addTodoItemComponent.addItem(todoName);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
TodoPageObject addGroceryItem(String todoName) {
|
TodoPageObject addGroceryItem(String todoName) {
|
||||||
addGroceryItemComponent.addItem(todoName);
|
addGroceryItemComponent.addItem(todoName);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemsListComponent getTodoList() {
|
ItemsListComponent getTodoList() {
|
||||||
return todoItemsList;
|
return todoItemsList;
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemsListComponent getGroceryList() {
|
ItemsListComponent getGroceryList() {
|
||||||
return groceryItemsList;
|
return groceryItemsList;
|
||||||
}
|
}
|
||||||
|
|
||||||
private WebElement findElementWithText(String text) {
|
private WebElement findElementWithText(String text) {
|
||||||
return driver.findElement(getConditionForText(text));
|
return driver.findElement(getConditionForText(text));
|
||||||
}
|
}
|
||||||
|
|
||||||
private By getConditionForText(String text) {
|
private By getConditionForText(String text) {
|
||||||
return By.xpath(format("//*[text()='%s']", text));
|
return By.xpath(format("//*[text()='%s']", text));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user