Skip to content

Instantly share code, notes, and snippets.

View nicolanrizzo's full-sized avatar

Nicola Rizzo nicolanrizzo

View GitHub Profile
# test/e2e/home/sample.feature
Feature: As a good developer i want to test my angular app in BDD
Scenario: I want to see the home page
Given I am on the "login"
When I fill "email" field with "donkeycode@example.org"
And I fill "password" field with "donkeycode"
And I click on the button "login"
Then I should be redirected on "home"
// test/e2e/support/pages/login/login.js
'use strict';
module.exports = function login() {
return {
url: "login",
getFieldByName: function (name) {
var mapping = {
"email": 'input[ng-model="login.mail"]'
// test/e2e/support/pages/login/login.js
'use strict';
module.exports = function login() {
return {
url: "login"
};
}();
// test/e2e/support/pages/login/login.js
'use strict';
module.exports = function login() {
return {
url: "login",
getFieldByName: function (name) {
var mapping = {
"email": 'input[ng-model="login.mail"]',
// test/e2e/support/pages/login/login.js
'use strict';
module.exports = function login() {
return {
url: "login",
getButtonByName: function (buttonName) {
var mapping = {
"login": ".btn"
// test/e2e/support/pages/home/home.js
'use strict';
module.exports = function home() {
return {
url: "home"
};
}();
// protractor.conf.js
exports.config = {
allScriptsTimeout: 99999,
// The address of a running selenium server.
// seleniumAddress: 'http://127.0.0.1:4444/wd/hub',
// The location of the selenium standalone server .jar file, relative
// to the location of this config. If no other method of starting selenium
Feature: As a good developer i want to test my angular app in BDD
Scenario: I want to see the home page
Given I am on the "login"
When I fill "email" field with "donkeycode@example.org"
And I fill "password" field with "donkeycode"
And I click on the button "login"
Then I should be redirected on "home"
.config(["$provide", "$windowProvider", function ($provide, $windowProvider) {
var $window = $windowProvider.$get();
$provide.decorator('$log', function ($delegate){
function appLogging(message, type) {
$.ajax({
type: "POST",
url: "http://10.10.10.10:8080",
contentType: "application/json",
data: angular.toJson({