Giter Club home page Giter Club logo

kakunin's Introduction

kakunin.png

travis.png Current travis build: build statusnpm.png Current npm version: npm version

Key FeaturesDocumentationContributingIssuesRelatedAbout us

pageObjectFeature.gif

Automated testing framework

Kakunin is a Protractor extension created by The Software House sp. z o.o. and Takamol Holding. It allows you to write e2e test scenarios with a help of Gherkin language and JavaScript for all kind of applications - Angular, React and others.


Key Features:

  1. E2E testing
  2. Performance testing
  3. Parallel testing
  4. Cross browser testing
  5. Reports

Documentation:

You can find documentation on the official page.


Contributing:

Feel free to contribute to this project! Just fork the code, make any updated and let us know!


Issues:

If you notice any issues while using, let as know on github. Security issues, please sent on email


You may also like our other projects:


About us:

The Software Housetsh.png

kakunin's People

Contributors

aherok avatar jarjak avatar mbasiakowski-tsh avatar sethii avatar simonsipl avatar tgorskievo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kakunin's Issues

Outdated deps

Hi. I'm trying to use this framework and its insisting on an older version of protractor-cucumber-framework (8.0.1) (or whatever the nearest point of dependency is, maybe cucumber.js?).

This versions outside of LTS and doesnt support modern versions of NodeJS (And thus cant be used with many modern packages, or for that matter many modern hosting setups, eg aws lambda)

Tests are terminated if alert box opens

Tests are terminated if alert box opens, there should be mechanism to ignore, accept or dismiss alertbox in config.

-.[15:30:42] E/launcher - unexpected alert open: {Alert text : }
  (Session info: chrome=64.0.3282.167)
  (Driver info: chromedriver=2.35.528157 (4429ca2590d6988c0745c24c8858745aaaec01ef),platform=Mac OS X 10.12.6 x86_64)
[15:30:42] E/launcher - UnexpectedAlertOpenError: unexpected alert open: {Alert text : }
  (Session info: chrome=64.0.3282.167)
  (Driver info: chromedriver=2.35.528157 (4429ca2590d6988c0745c24c8858745aaaec01ef),platform=Mac OS X 10.12.6 x86_64)
    at Object.checkLegacyResponse (/Users/hikaryu/TSH_Projects/*/e2e-tests/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:553:13)
    at parseHttpResponse (/Users/hikaryu/TSH_Projects/*/e2e-tests/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:509:13)
    at doSend.then.response (/Users/hikaryu/TSH_Projects/*/e2e-tests/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:441:30)
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:228:7)
From: Task: WebDriver.manage().deleteAllCookies()
    at thenableWebDriverProxy.schedule (/Users/hikaryu/TSH_Projects/*/e2e-tests/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:807:17)
    at Options.deleteAllCookies (/Users/hikaryu/TSH_Projects/*/e2e-tests/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:1263:25)
    at cookiesFunc (/Users/hikaryu/TSH_Projects/*/e2e-tests/node_modules/kakunin/dist/configuration/hooks.js:58:53)
    at clearCookiesAndLocalStorage (/Users/hikaryu/TSH_Projects/*/e2e-tests/node_modules/kakunin/dist/configuration/hooks.js:66:3)
    at takeScreenshot.then (/Users/hikaryu/TSH_Projects/*/e2e-tests/node_modules/kakunin/dist/configuration/hooks.js:90:9)
    at ManagedPromise.invokeCallback_ (/Users/hikaryu/TSH_Projects/*/e2e-tests/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1376:14)
    at TaskQueue.execute_ (/Users/hikaryu/TSH_Projects/*/e2e-tests/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:3084:14)
    at TaskQueue.executeNext_ (/Users/hikaryu/TSH_Projects/*/e2e-tests/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:3067:27)
    at asyncRun (/Users/hikaryu/TSH_Projects/*/e2e-tests/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2927:27)
    at /Users/hikaryu/TSH_Projects/BrickVest/e2e-tests/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:668:7
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:228:7)
[15:30:42] E/launcher - Process exited with error code 199

Performance testing improvement

1. Update README.md

  • add an example of usage
  • list performance step

2. Add possibility to run performance tests with hooks:

AfterAll, BeforeAll

Currently, there is a problem if the scenario which supposes to save and compare values failed.
Hooks would resolve this problem.

[RFC] Allow setting headless as CLI param

Usually I run tests in headless mode, but sometimes I want to check what is going on in browser. I would be nice to have an ability to replace headless config param in CLI. Then I could do:

npm run kakunin -- --headless false
npm run kakunin -- --tags @wip --headless false

Change context to page with parital url match

Hi,

how to set the context to the current page with dynamic URL parameters.

Scenario:

In my service, I'm able to add articles. Each article have own url part in order <host>/articles/<article_id>. When in test I use step And the "<string>" page is displayed I get error connected with URL matching.
Also in node_modules/kakunin/dist/pages/base.js I have added lines

console.log(_this.url)
console.log(currentUrl)

and get in console

/article
http://localhost:4100/article/pr-o2aqze

and error

And the "ArticlePreview" page is displayed # node_modules/kakunin/dist/step_definitions/navigation.js:22
TimeoutError: Wait timed out after 5005ms
at ...node_modules/selenium-webdriver/lib/promise.js:2201:17
at ManagedPromise.invokeCallback_ (...node_modules/selenium-webdriver/lib/promise.js:1376:14)
at TaskQueue.execute_ (...node_modules/selenium-webdriver/lib/promise.js:3084:14)
at TaskQueue.executeNext_ (...node_modules/selenium-webdriver/lib/promise.js:3067:27)
at asyncRun (...node_modules/selenium-webdriver/lib/promise.js:2927:27)
at ...node_modules/selenium-webdriver/lib/promise.js:668:7
at <anonymous>
at process._tickDomainCallback (internal/process/next_tick.js:228:7)
From: Task: <anonymous wait>
at scheduleWait (...node_modules/selenium-webdriver/lib/promise.js:2188:20)
at ControlFlow.wait (...node_modules/selenium-webdriver/lib/promise.js:2517:12)
at thenableWebDriverProxy.wait (...node_modules/selenium-webdriver/lib/webdriver.js:934:29)
at run (...node_modules/protractor/built/browser.js:59:33)
at ProtractorBrowser.to.(anonymous function) [as wait] (...node_modules/protractor/built/browser.js:67:16)
at ...node_modules/kakunin/dist/pages/base.js:52:22
at Generator.next (<anonymous>)
at step (...node_modules/kakunin/dist/pages/base.js:17:191)
at ...node_modules/kakunin/dist/pages/base.js:17:437
at new Promise (<anonymous>)
at ...node_modules/kakunin/dist/pages/base.js:17:99
at ArticlePreview.isOn (...node_modules/kakunin/dist/pages/base.js:60:7)
at World.<anonymous> (...node_modules/kakunin/dist/step_definitions/navigation.js:25:35)

and the ArticlePreview class

'use strict';
const { BasePage } = require('kakunin');
class ArticlePreview extends BasePage {
    constructor() {
        super();
        this.url = "/article";
        this.Title = $('h1');
        this.Description = $('#root > div > div > div.container.page > div.row.article-content > div > div > p')
    }
}
module.exports = ArticlePreview;

Expected behaviour:

New step with partial match or better implementation of current steps

Enable automation of prompts from npm run kakunin init

On npm run kakunin init
I am asked three questions which I need to provide input manually:
? What kind of application would you like to test? otherWeb
? What is base url? [http://localhost:3000] http://todomvc.com
? What kind of email service would you like to use? none
But I would like for a script to automatically provide these answers.
After all, the whole point of Kanunin is for automation.

Allow to test rest endpoints with kakunin

  • When I upload file
  • Then I should get file
  • Then the response matches JSON schema
  • Then the request is equal to
  • When I set headers
  • When I send “method” with body”

Kakunin failing to run, exits with `code: 100`

Hi,

Recently kakunin in our project stopped working, and I'm not sure why.. Perhaps it's MacOS acting up, perhaps not.

This is the error i'm getting:

$ make e2e
make server
bin/console server:start 127.0.0.1:8088 -q || true
cd tests/e2e && npm run kakunin && cd ../..

> e2e@ kakunin /Users/bob/Sites/bolt-four/tests/e2e
> cross-env NODE_ENV=prod kakunin

All reports have been deleted!
[15:43:50] I/launcher - Running 1 instances of WebDriver
[15:43:50] I/local - Starting selenium standalone server...
[15:43:50] E/launcher - Error: Error: Server terminated early with status 1
    at /Users/bob/Sites/bolt-four/tests/e2e/node_modules/selenium-webdriver/remote/index.js:252:52
    at processTicksAndRejections (internal/process/task_queues.js:82:5)
[15:43:50] E/launcher - Process exited with error code 100
Protractor has finished
npm ERR! code ELIFECYCLE
npm ERR! errno 100
npm ERR! e2e@ kakunin: `cross-env NODE_ENV=prod kakunin`
npm ERR! Exit status 100
npm ERR!
npm ERR! Failed at the e2e@ kakunin script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/bob/.npm/_logs/2019-07-08T13_43_50_890Z-debug.log
make: *** [e2e] Error 100

deubug.log is:

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/usr/local/Cellar/node/12.5.0/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   'kakunin'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prekakunin', 'kakunin', 'postkakunin' ]
5 info lifecycle e2e@~prekakunin: e2e@
6 info lifecycle e2e@~kakunin: e2e@
7 verbose lifecycle e2e@~kakunin: unsafe-perm in lifecycle true
8 verbose lifecycle e2e@~kakunin: PATH: [snip]
9 verbose lifecycle e2e@~kakunin: CWD: /Users/bob/Sites/bolt-four/tests/e2e
10 silly lifecycle e2e@~kakunin: Args: [ '-c', 'cross-env NODE_ENV=prod kakunin' ]
11 silly lifecycle e2e@~kakunin: Returned: code: 100  signal: null
12 info lifecycle e2e@~kakunin: Failed to exec kakunin script
13 verbose stack Error: e2e@ kakunin: `cross-env NODE_ENV=prod kakunin`
13 verbose stack Exit status 100
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:200:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:200:13)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid e2e@
15 verbose cwd /Users/bob/Sites/bolt-four/tests/e2e
16 verbose Darwin 18.6.0
17 verbose argv "/usr/local/Cellar/node/12.5.0/bin/node" "/usr/local/bin/npm" "run" "kakunin"
18 verbose node v12.5.0
19 verbose npm  v6.9.0
20 error code ELIFECYCLE
21 error errno 100
22 error e2e@ kakunin: `cross-env NODE_ENV=prod kakunin`
22 error Exit status 100
23 error Failed at the e2e@ kakunin script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 100, true ]

Current versions:

$ npm -v 
6.9.0
$ node -v  
v12.5.0

Package.json has this:

{
  "name": "e2e",
  "description": "Bolt E2E tests",
  "private": true,
  "scripts": {
    "kakunin": "cross-env NODE_ENV=prod kakunin"
  },
  "dependencies": {
    "cross-env": "^5.2.0",
    "kakunin": "^3.0",
    "protractor": "^5.4.2",
    "webdriver-manager": "^13.0.0"
  }
}

(i've tried upgrading from Kakunin 2.6 to 3.0, but that didn't make a difference in this case)

Any idea what might cause this?

Outdated documentation for 'there is element * with regex'

Hi!
I wanted to write test using regex.
When I looked in doc I found:

there is element ":elementName" with regex ":matcher"

https://thesoftwarehouse.github.io/Kakunin/docs/steps-elements#there-is-no-element-elementname-with-regex-matcher

Unfortunately this scenario doesn't work:

   ? Then there is element "body" with regex "<matcher>"
       Undefined. Implement with the following snippet:

         Then('there is element {string} with regex {string}', function (string, string2) {
           // Write code here that turns the phrase above into concrete actions
           return 'pending';
         });

Probably this is the correct version:

there is element "([^"]*)" with "([^"]*)" regex

Please update documentation/code :)

Version: 3.0.

Code from @downloadClearAfter tag doesn't remove files that have a space in the name

Hi.
I added tag to remove files when test ends, but it doesn't work when filename contain space.
In situation when I have filename without space everything works good.

I have this problem when I use docker containers, I didn't check how it works without dockers.

Scenario:

Feature: my_feature
  @downloadClearAfter
  Scenario: Download file
    When I click the "button_to_download_file" element
    Then the file "my file.format" should be downloaded

Problem:
When test ends downloaded files that have a space in the name are not removed

Expectation:
When test ends downloaded files are always removed

"Switch" to a newly opened window

Hi! 👋

I'm working on a test where i want to see if something appears in a dynamically opened window. So far, my .feature looks like:

Feature: Edit record

    @wip
    Scenario: As an Admin I want to preview an edited record
        Given I am logged in as "admin"

        When I visit the "edit_record" page with parameters:
            | id | 30 |
        Then I wait for "title_field" element to appear

        When I fill the "title_field" field with "Check preview"
        And I click the "preview_button" element
        Then I wait for "frontend_title" element to appear
        Then there is element "frontend_title" with text "Check preview"

My pages/….js looks like:

const { BasePage } = require('kakunin');

class EditRecordPage extends BasePage {
  constructor() {
    super();

 

    this.preview_button = $('button[type="submit"][formaction*="/bolt/preview/"]');

    this.frontend_title = $('h1.title');
  }
}

module.exports = EditRecordPage;

I can see it working correctly up until And I click the "preview_button" element after which a new browser window is spawned, with the correct contents.

My question is: how can i tell the test to "switch" to this new window, in order to verify the frontend_title contains the text I need? Is this possible?

Add possibility to easily check values in dropdownlist

A step like "Then the available values for 'e:dropdownlist' are 'value1, value2, value3' " would come in really handy, expecially when the dropdownlist consists of a lot of values.
Now i have to use "And there is element 'dropdownListitem1' with value 't:value1'". This results in very long scenarios and I have to define a new page object for every single value.

Add a new step - as many checkers as a user wants for an element in table

Add a new step

Add a new step which works as there are following elements in table but allows to check more elements than element array contains.

Example:

this.exampleTable = $$('.example-table'); // for example, there is only 1 element in HTML
// so the following step will not work because it requires exact numbers of columns etc.

        Then there are following elements in table "exampleTable":
            | elementOne    | elementTwo    | elementThree  |
            | f:isVisible        | f:isVisible   | f:isVisible   |
            | r:notEmpty     | r:notEmpty       | r:notEmpty    |
            | r:date            | r:date                 | r:date        |
            | f:isClickable | f:isClickable | f:isClickable |

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.