BDD End-to-end Browser-Testing mit Node.js Entwicklertag Frankfurt - - PowerPoint PPT Presentation

bdd end to end browser testing mit node js
SMART_READER_LITE
LIVE PREVIEW

BDD End-to-end Browser-Testing mit Node.js Entwicklertag Frankfurt - - PowerPoint PPT Presentation

BDD End-to-end Browser-Testing mit Node.js Entwicklertag Frankfurt 2016 10.3.2016 Markus Tacker Channeller of Technological Obscurities (CTO) @coderbyheart cto.hiv Turning organizations into entrepreneurial networks The way to


slide-1
SLIDE 1

BDD End-to-end Browser-Testing mit Node.js

Entwicklertag Frankfurt 2016 · 10.3.2016

slide-2
SLIDE 2

Markus Tacker

Channeller of Technological Obscurities (CTO) @coderbyheart · cto.hiv

slide-3
SLIDE 3

Turning organizations into entrepreneurial networks

slide-4
SLIDE 4

“The way to creating Leaders at every level is The Way of Resourceful Humans” “The way to creating Leaders at every level is The Way of Resourceful Humans”

Captain David L. Marquet US Navy (retired) Captain Nuclear Submarine USS Santa Fe Captain David L. Marquet US Navy (retired) Captain Nuclear Submarine USS Santa Fe

slide-5
SLIDE 5

Resourceful Technology

  • JavaScript (ES6)
  • Backend: Node.js, Redis, CQRS/ES
  • Frontend: Angular.js (1.5+), Bootstrap v4, make
  • Android, iOS
  • Commodity: in the cloud
  • AWS
  • Elastic Beanstalk
  • Lambda
  • Travis CI
  • Greenkeeper.io
  • Google Apps for Work
  • Slack
slide-6
SLIDE 6

Resourceful Tools

netwoRHk enables, promotes and visualizes truly customer- focused teamwork staRHs beautifully visualized 360-degree feedback caRHds enables, demands and visualises everybody to contribute to valuable meetings

slide-7
SLIDE 7

BDD: Short intro

Let user stories drive your (product) development

Title (one line describing the story) (Narrative) As a [role] I want [feature] So that [benefit] Scenario 1…n: Title Given [context] And [some more context]... When [event] Then [outcome] And [another outcome]...

Read more at: http://dannorth.net/whats-in-a-story/

slide-8
SLIDE 8

BDD: Benefits

  • plain english
  • easy to scan
  • easy to discuss about with non-developers
  • not tied to code (in contrast to unit tests)
  • user-story format widely used in agile teams
slide-9
SLIDE 9

Browser-based testing: PITA

applying BDD to browser based testing …

  • makes writing tests more fun
  • forces you to write expressive markup
  • takes time to implement underlying execution logic
slide-10
SLIDE 10

Yadda: BDD for Node.js

https://github.com/acuminous/yadda

  • General purpose BDD library, can be run with your test runner
  • we use mocha
  • and Selenium (we want real browser tests)
  • headless is also supported via PhantomJS
slide-11
SLIDE 11

Yadda: BDD for Node.js

How it works:

  • testrunner reads .feature files
  • initiates global context with a selenium instance
  • executes steps
  • for every condition (regexp match) a method in the context files is called
  • which calls your favorite assertion library
slide-12
SLIDE 12

Context step definition example

Step: When I enter "187.000 €" into the input amount Step definition:

.when(/^I enter "([^"]+)" into the input (.+)$/, function (value, input, next) { this.driver.findElement(By.name(input)).sendKeys(r(value)).then(next); })

slide-13
SLIDE 13

Live demo ☠

slide-14
SLIDE 14

Questions?

slide-15
SLIDE 15

Thank you!

Slides https://goo.gl/03zXZY Code on GitHub https://goo.gl/o9OvQP Please rate this talk! http://lanyrd.com/sdwtpy

  • r send feedback to

@coderbyheart markus@resourceful-humans.com