changeset 2931:f90f2fd94fbc

added regression test for protocols
author Thomas Junk <thomas.junk@intevation.de>
date Thu, 04 Apr 2019 12:25:35 +0200
parents 1019f4d0e18f
children 173ce013a021
files client/src/components/Logs.vue client/tests/e2e/reports/import.xml client/tests/e2e/reports/login.xml client/tests/e2e/reports/protocols.xml client/tests/e2e/specs/import.js client/tests/e2e/specs/protocols.js
diffstat 6 files changed, 195 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/Logs.vue	Thu Apr 04 11:22:25 2019 +0200
+++ b/client/src/components/Logs.vue	Thu Apr 04 12:25:35 2019 +0200
@@ -14,6 +14,7 @@
             <ul class="nav nav-pills">
               <li class="nav-item">
                 <a
+                  id="accesslog"
                   :class="accesslogStyle"
                   @click.prevent="
                     fetch('system/log/apache2/access.log', 'accesslog')
@@ -25,6 +26,7 @@
               </li>
               <li class="nav-item">
                 <a
+                  id="errorlog"
                   :class="errorlogStyle"
                   @click.prevent="
                     fetch('system/log/apache2/error.log', 'errorlog')
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/tests/e2e/reports/import.xml	Thu Apr 04 12:25:35 2019 +0200
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<testsuites errors="0"
+            failures="0"
+            tests="6">
+
+  <testsuite name="import"
+    errors="0" failures="0" hostname="" id="" package="import" skipped="6"
+    tests="6" time="0.000" timestamp="Thu, 04 Apr 2019 10:16:03 GMT">
+  
+
+  
+    <system-err>
+        Error while running [Protocols / Loading protocols]:
+
+  TypeError: browser.url(...).waitForElementVisible(...).setValue(...).setValue(...).click(...).pause(...).click(...).pause(...).click(...).pause(...).url.contains is not a function
+    at Object.Loading protocols (/home/thomas/go/src/gemma.intevation.de/gemma/client/tests/e2e/specs/protocols.js:31:12)
+    at Module.call (/home/thomas/go/src/gemma.intevation.de/gemma/client/node_modules/nightwatch/lib/runner/module.js:62:34)
+    at /home/thomas/go/src/gemma.intevation.de/gemma/client/node_modules/nightwatch/lib/runner/testcase.js:70:29
+    at _fulfilled (/home/thomas/go/src/gemma.intevation.de/gemma/client/node_modules/q/q.js:834:54)
+    at self.promiseDispatch.done (/home/thomas/go/src/gemma.intevation.de/gemma/client/node_modules/q/q.js:863:30)
+    at Promise.promise.promiseDispatch (/home/thomas/go/src/gemma.intevation.de/gemma/client/node_modules/q/q.js:796:13)
+    at /home/thomas/go/src/gemma.intevation.de/gemma/client/node_modules/q/q.js:556:49
+    at runSingle (/home/thomas/go/src/gemma.intevation.de/gemma/client/node_modules/q/q.js:137:13)
+    at flush (/home/thomas/go/src/gemma.intevation.de/gemma/client/node_modules/q/q.js:125:13)
+    at _combinedTickCallback (internal/process/next_tick.js:132:7)
+    </system-err>
+  
+
+  
+    
+    <testcase
+      name="Bottleneck import" classname="import">
+      <skipped />
+    </testcase>
+    
+    <testcase
+      name="Available fairwaydepth" classname="import">
+      <skipped />
+    </testcase>
+    
+    <testcase
+      name="Gauge measurement" classname="import">
+      <skipped />
+    </testcase>
+    
+    <testcase
+      name="Import Fairway Dimensions" classname="import">
+      <skipped />
+    </testcase>
+    
+    <testcase
+      name="Import Waterway Axis" classname="import">
+      <skipped />
+    </testcase>
+    
+    <testcase
+      name="Import Waterway Area " classname="import">
+      <skipped />
+    </testcase>
+    
+  
+  </testsuite>
+</testsuites>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/tests/e2e/reports/login.xml	Thu Apr 04 12:25:35 2019 +0200
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<testsuites errors="0"
+            failures="0"
+            tests="5">
+
+  <testsuite name="login"
+    errors="0" failures="0" hostname="" id="" package="login" skipped="5"
+    tests="5" time="0.000" timestamp="Thu, 04 Apr 2019 10:16:03 GMT">
+  
+
+  
+    <system-err>
+        Error while running [Protocols / Loading protocols]:
+
+  TypeError: browser.url(...).waitForElementVisible(...).setValue(...).setValue(...).click(...).pause(...).click(...).pause(...).click(...).pause(...).url.contains is not a function
+    at Object.Loading protocols (/home/thomas/go/src/gemma.intevation.de/gemma/client/tests/e2e/specs/protocols.js:31:12)
+    at Module.call (/home/thomas/go/src/gemma.intevation.de/gemma/client/node_modules/nightwatch/lib/runner/module.js:62:34)
+    at /home/thomas/go/src/gemma.intevation.de/gemma/client/node_modules/nightwatch/lib/runner/testcase.js:70:29
+    at _fulfilled (/home/thomas/go/src/gemma.intevation.de/gemma/client/node_modules/q/q.js:834:54)
+    at self.promiseDispatch.done (/home/thomas/go/src/gemma.intevation.de/gemma/client/node_modules/q/q.js:863:30)
+    at Promise.promise.promiseDispatch (/home/thomas/go/src/gemma.intevation.de/gemma/client/node_modules/q/q.js:796:13)
+    at /home/thomas/go/src/gemma.intevation.de/gemma/client/node_modules/q/q.js:556:49
+    at runSingle (/home/thomas/go/src/gemma.intevation.de/gemma/client/node_modules/q/q.js:137:13)
+    at flush (/home/thomas/go/src/gemma.intevation.de/gemma/client/node_modules/q/q.js:125:13)
+    at _combinedTickCallback (internal/process/next_tick.js:132:7)
+    </system-err>
+  
+
+  
+    
+    <testcase
+      name="Page Load" classname="login">
+      <skipped />
+    </testcase>
+    
+    <testcase
+      name="Login failed" classname="login">
+      <skipped />
+    </testcase>
+    
+    <testcase
+      name="Login oana success" classname="login">
+      <skipped />
+    </testcase>
+    
+    <testcase
+      name="Login oana switch url" classname="login">
+      <skipped />
+    </testcase>
+    
+    <testcase
+      name="Login switch user from oana to sophie" classname="login">
+      <skipped />
+    </testcase>
+    
+  
+  </testsuite>
+</testsuites>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/tests/e2e/reports/protocols.xml	Thu Apr 04 12:25:35 2019 +0200
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<testsuites errors="1"
+            failures="0"
+            tests="1">
+
+  <testsuite name="protocols"
+    errors="1" failures="0" hostname="" id="" package="protocols" skipped="0"
+    tests="1" time="0.005000" timestamp="Thu, 04 Apr 2019 10:16:03 GMT">
+  
+    <testcase name="Loading protocols" classname="protocols" time="0.005000" assertions="0">
+    </testcase>
+  
+
+  
+    <system-err>
+        Error while running [Protocols / Loading protocols]:
+
+  TypeError: browser.url(...).waitForElementVisible(...).setValue(...).setValue(...).click(...).pause(...).click(...).pause(...).click(...).pause(...).url.contains is not a function
+    at Object.Loading protocols (/home/thomas/go/src/gemma.intevation.de/gemma/client/tests/e2e/specs/protocols.js:31:12)
+    at Module.call (/home/thomas/go/src/gemma.intevation.de/gemma/client/node_modules/nightwatch/lib/runner/module.js:62:34)
+    at /home/thomas/go/src/gemma.intevation.de/gemma/client/node_modules/nightwatch/lib/runner/testcase.js:70:29
+    at _fulfilled (/home/thomas/go/src/gemma.intevation.de/gemma/client/node_modules/q/q.js:834:54)
+    at self.promiseDispatch.done (/home/thomas/go/src/gemma.intevation.de/gemma/client/node_modules/q/q.js:863:30)
+    at Promise.promise.promiseDispatch (/home/thomas/go/src/gemma.intevation.de/gemma/client/node_modules/q/q.js:796:13)
+    at /home/thomas/go/src/gemma.intevation.de/gemma/client/node_modules/q/q.js:556:49
+    at runSingle (/home/thomas/go/src/gemma.intevation.de/gemma/client/node_modules/q/q.js:137:13)
+    at flush (/home/thomas/go/src/gemma.intevation.de/gemma/client/node_modules/q/q.js:125:13)
+    at _combinedTickCallback (internal/process/next_tick.js:132:7)
+    </system-err>
+  
+
+  
+  </testsuite>
+</testsuites>
--- a/client/tests/e2e/specs/import.js	Thu Apr 04 11:22:25 2019 +0200
+++ b/client/tests/e2e/specs/import.js	Thu Apr 04 12:25:35 2019 +0200
@@ -16,6 +16,7 @@
 // http://nightwatchjs.org/guide#usage
 
 module.exports = {
+  "@disabled": true,
   "Bottleneck import": browser => {
     browser
       .url(process.env.VUE_DEV_SERVER_URL)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/tests/e2e/specs/protocols.js	Thu Apr 04 12:25:35 2019 +0200
@@ -0,0 +1,37 @@
+/* This is Free Software under GNU Affero General Public License v >= 3.0
+ * without warranty, see README.md and license for details.
+ *
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ * License-Filename: LICENSES/AGPL-3.0.txt
+ *
+ * Copyright (C) 2018 by via donau
+ *   – Österreichische Wasserstraßen-Gesellschaft mbH
+ * Software engineering by Intevation GmbH
+ *
+ * Author(s):
+ * Thomas Junk <thomas.junk@intevation.de>
+ */
+
+// For authoring Nightwatch tests, see
+// http://nightwatchjs.org/guide#usage
+
+module.exports = {
+  "Loading protocols": browser => {
+    browser
+      .url(process.env.VUE_DEV_SERVER_URL)
+      .waitForElementVisible("#app", 5000)
+      .setValue("input[id='inputUsername']", "sophie")
+      .setValue("input[id='inputPassword']", "so2Phie4")
+      .click("button[type='submit']")
+      .pause(1000)
+      .click(".menubutton")
+      .pause(1000)
+      .click("a[href='#/logs']")
+      .pause(1000)
+      .assert.urlContains("#/logs")
+      .click("#accesslog")
+      .click("#errorlog")
+      .assert.urlContains("#/logs")
+      .end();
+  }
+};