Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Commit

Permalink
added features and step definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
tewksbum committed Aug 1, 2017
1 parent 742cd53 commit f1beb53
Show file tree
Hide file tree
Showing 21 changed files with 1,049 additions and 103 deletions.
37 changes: 37 additions & 0 deletions .circleci/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:7.10

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/mongo:3.4.4

working_directory: ~/repo

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: yarn install

- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}

# run tests!
- run: yarn test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
47 changes: 47 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
'use strict';

var path = require('path');

module.exports = function(grunt) {

grunt.initConfig({

env: {
chrome: {
PLATFORM: 'CHROME'
},
firefox: {
PLATFORM: 'FIREFOX'
},
android: {
PLATFORM: 'ANDROID'
}
},

jshint: {
all: ['Gruntfile.js', 'features/step_definitions/*.js', 'features/support/*.js'],
options: {
node: true,
strict: true,
globalstrict: true,
'esversion':6
}
},

exec: {
run_cucumber_tests: {
command: 'node ' + path.join('node_modules', 'cucumber', 'bin', 'cucumber.js -f pretty -t @for_testing')
}
}

});

grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-exec');
grunt.loadNpmTasks('grunt-env');

grunt.registerTask('default', ['jshint', 'exec']);
grunt.registerTask('chrome', ['env:chrome', 'jshint', 'exec']);
grunt.registerTask('firefox', ['env:firefox', 'jshint', 'exec']);

};
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
* https://www.slideshare.net/qaoth/the-art-of-gherkin-scripting-matt-eakin
* https://github.com/wakaleo/movie-service/blob/master/src/test/resources/features/search/searching_for_movies.feature


JSON Viewer
http://jsonviewer.stack.hu/
2 changes: 2 additions & 0 deletions configuration.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
exports.BASE_URL="https://api.utu.ai/v1/";
exports.TEST_TYPE="REST";
49 changes: 0 additions & 49 deletions dialog/post_message.feature

This file was deleted.

216 changes: 216 additions & 0 deletions features/dialog/dialog.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
Running "jshint:all" (jshint) task
>> 1 file lint free.

Running "exec:run_cucumber_tests" (exec) task
@dialog @receive_message
Feature: new message

All valid messages
should be captured in their raw form
persisted
and then denorm'd to all related services

Why:
- we can run sentiment models on user's text to evaluate their state of mind
- in the future, we will likely get in the intent business ourselves. having the raw data will be useful.
- in any consumer analytics environment, hold on to ALL the data you can, for as LONG as you can.

Rules:
- the inbound message must containt a bot key (which kong decodes to org and botId) as well as p/pId

@for_testing @acceptance @valid_message_received @for_testing
Scenario: Received valid message from existing user for active dialog
Given there are Identity records as follows:
| identityKey  |
| TIN_RECORD  |
| BRONZE_RECORD |
| GOLD_RECORD  |
When a valid new message is received for an existing user who is actively dialoging
Then save the Message
And update Dialog with Message
And update Identity with Message
And create a summarized Event for Message

@acceptance @valid_message_received @for_testing
Scenario: Received valid message from existing user for new dialog
Given there are Identity records as follows:
| identityKey  |
| TIN_RECORD  |
| BRONZE_RECORD |
| GOLD_RECORD  |
When a valid new message is received for an existing user starting a new dialog
Then save the Message
And update Dialog with Message
And update Identity with Message
And create a summarized Event for Message

@acceptance @valid_message_received @for_testing
Scenario: Received valid message from new user
Given there are Identity records as follows:
| identityKey  |
| TIN_RECORD  |
| BRONZE_RECORD |
| GOLD_RECORD  |
When a valid new message is received from a new user
Then save the Message
And update Dialog with Message
And update Identity with Message
And create a summarized Event for Message

Warnings:

1) Scenario: Received valid message from existing user for active dialog - features/dialog/post_message.feature:28
Step: When a valid new message is received for an existing user who is actively dialoging - features/dialog/post_message.feature:29
Message:
Undefined. Implement with the following snippet:

this.When(/^a valid new message is received for an existing user who is actively dialoging$/, function (callback) {
// Write code here that turns the phrase above into concrete actions
callback(null, 'pending');
});

2) Scenario: Received valid message from existing user for active dialog - features/dialog/post_message.feature:28
Step: Then save the Message - features/dialog/post_message.feature:30
Message:
Undefined. Implement with the following snippet:

this.Then(/^save the Message$/, function (callback) {
// Write code here that turns the phrase above into concrete actions
callback(null, 'pending');
});

3) Scenario: Received valid message from existing user for active dialog - features/dialog/post_message.feature:28
Step: And update Dialog with Message - features/dialog/post_message.feature:31
Message:
Undefined. Implement with the following snippet:

this.Then(/^update Dialog with Message$/, function (callback) {
// Write code here that turns the phrase above into concrete actions
callback(null, 'pending');
});

4) Scenario: Received valid message from existing user for active dialog - features/dialog/post_message.feature:28
Step: And update Identity with Message - features/dialog/post_message.feature:32
Message:
Undefined. Implement with the following snippet:

this.Then(/^update Identity with Message$/, function (callback) {
// Write code here that turns the phrase above into concrete actions
callback(null, 'pending');
});

5) Scenario: Received valid message from existing user for active dialog - features/dialog/post_message.feature:28
Step: And create a summarized Event for Message - features/dialog/post_message.feature:33
Message:
Undefined. Implement with the following snippet:

this.Then(/^create a summarized Event for Message$/, function (callback) {
// Write code here that turns the phrase above into concrete actions
callback(null, 'pending');
});

6) Scenario: Received valid message from existing user for new dialog - features/dialog/post_message.feature:36
Step: When a valid new message is received for an existing user starting a new dialog - features/dialog/post_message.feature:37
Message:
Undefined. Implement with the following snippet:

this.When(/^a valid new message is received for an existing user starting a new dialog$/, function (callback) {
// Write code here that turns the phrase above into concrete actions
callback(null, 'pending');
});

7) Scenario: Received valid message from existing user for new dialog - features/dialog/post_message.feature:36
Step: Then save the Message - features/dialog/post_message.feature:38
Message:
Undefined. Implement with the following snippet:

this.Then(/^save the Message$/, function (callback) {
// Write code here that turns the phrase above into concrete actions
callback(null, 'pending');
});

8) Scenario: Received valid message from existing user for new dialog - features/dialog/post_message.feature:36
Step: And update Dialog with Message - features/dialog/post_message.feature:39
Message:
Undefined. Implement with the following snippet:

this.Then(/^update Dialog with Message$/, function (callback) {
// Write code here that turns the phrase above into concrete actions
callback(null, 'pending');
});

9) Scenario: Received valid message from existing user for new dialog - features/dialog/post_message.feature:36
Step: And update Identity with Message - features/dialog/post_message.feature:40
Message:
Undefined. Implement with the following snippet:

this.Then(/^update Identity with Message$/, function (callback) {
// Write code here that turns the phrase above into concrete actions
callback(null, 'pending');
});

10) Scenario: Received valid message from existing user for new dialog - features/dialog/post_message.feature:36
Step: And create a summarized Event for Message - features/dialog/post_message.feature:41
Message:
Undefined. Implement with the following snippet:

this.Then(/^create a summarized Event for Message$/, function (callback) {
// Write code here that turns the phrase above into concrete actions
callback(null, 'pending');
});

11) Scenario: Received valid message from new user - features/dialog/post_message.feature:44
Step: When a valid new message is received from a new user - features/dialog/post_message.feature:45
Message:
Undefined. Implement with the following snippet:

this.When(/^a valid new message is received from a new user$/, function (callback) {
// Write code here that turns the phrase above into concrete actions
callback(null, 'pending');
});

12) Scenario: Received valid message from new user - features/dialog/post_message.feature:44
Step: Then save the Message - features/dialog/post_message.feature:46
Message:
Undefined. Implement with the following snippet:

this.Then(/^save the Message$/, function (callback) {
// Write code here that turns the phrase above into concrete actions
callback(null, 'pending');
});

13) Scenario: Received valid message from new user - features/dialog/post_message.feature:44
Step: And update Dialog with Message - features/dialog/post_message.feature:47
Message:
Undefined. Implement with the following snippet:

this.Then(/^update Dialog with Message$/, function (callback) {
// Write code here that turns the phrase above into concrete actions
callback(null, 'pending');
});

14) Scenario: Received valid message from new user - features/dialog/post_message.feature:44
Step: And update Identity with Message - features/dialog/post_message.feature:48
Message:
Undefined. Implement with the following snippet:

this.Then(/^update Identity with Message$/, function (callback) {
// Write code here that turns the phrase above into concrete actions
callback(null, 'pending');
});

15) Scenario: Received valid message from new user - features/dialog/post_message.feature:44
Step: And create a summarized Event for Message - features/dialog/post_message.feature:49
Message:
Undefined. Implement with the following snippet:

this.Then(/^create a summarized Event for Message$/, function (callback) {
// Write code here that turns the phrase above into concrete actions
callback(null, 'pending');
});

3 scenarios (3 undefined)
18 steps (15 undefined, 3 passed)
0m00.003s

Done.
Loading

0 comments on commit f1beb53

Please sign in to comment.