GithubHelp home page GithubHelp logo

fiveby's Introduction

npm build status Code Climate Coverage Status

All the things you expect from a robust testing framework by neatly packaging: WebDriverJS, mocha, and should chai with a little glue and zero magic:

var fiveby = require('fiveby');

fiveby(function (browser) {
  return describe('Google Search in ' + browser.name, function () {
      it('should work', function () {
        browser.get('http://www.google.com');
        var searchBox = browser.findElement(by.name('q'));
        searchBox.sendKeys('awesome');
        return searchBox.getAttribute('value').then(function (value) {
          'awesome'.should.equal(value);
        });
      });
    });
});

Run it (quick)

npx mocha tests/** --delay --timeout 30000

OR (recommended)

Add gulp and some convention to make it even more powerful: slush-fiveby. slush-fiveby is a simple fiveby project generator/example.

Sauce Labs

What's unique about fiveby?

Configuration (fiveby-config.json)

{
  "implicitWait": 5000,
  "hubUrl": null,
  "browsers": {
    "firefox": true,
    "chrome": {
      "version": "37.0.2062.103",
      "chromeOptions": {
          "args": ["--disable-extensions", "--headless"]
        }
    },
    "phantomjs": true
  },
  "disableBrowsers": false
}

disableBrowsers and hubUrl are optional, disableBrowser defaults to false.

English?

Have little to no experience with end to end testing?

Ok, this tool will allow you to write a bit of javascript that will open any browser (or mobile app), emulate user behavior via a few simple commands, and then verify what's displayed onscreen is correct. You can compile large suites of these tests and easily run them against many different browsers at once and get nice reports. It can be run with something like jenkins to automate further. Or use any of the popular SaaS providers like:

Sauce Labs BrowserStack

Pre-reqs

  • node.js
  • mocha cli (you can use npm scripts to avoid this)
  • java (for selenium)
  • the appropriate webdriver
  • you can avoid installing the server, webdriver, and browser deps by using docker, see docker-compose.yaml @slush-fiveby

See docs folder for even more details!

fiveby's People

Contributors

scott2449 avatar sstaedt avatar lkoskela avatar mrchief avatar grawk avatar ntgv93 avatar dependabot[bot] avatar

Stargazers

Yasin ATEŞ avatar Thomas avatar Erick De Santiago avatar Jeremy Bae avatar Kaan Dolgun avatar Gabor Dolla avatar Franchesco Romero avatar Vita Kr avatar  avatar Ashley Narcisse avatar Renato Silva avatar Gavin Wong avatar Alan Rodríguez avatar  avatar Mek Stittri avatar Parker avatar Nam Nguyen avatar Chris Zubak-Skees avatar Lee Provoost avatar Anibal avatar Rob DiCiuccio avatar Gabriel Dumitrescu avatar  avatar Alexandru Vlăduţu avatar Carlos Iriarte avatar 余凡 avatar Cam Song avatar Marko Grešak avatar David Pelaez avatar Stu Weir avatar Jason Walton avatar David Livingston avatar Maurizio Del Corno avatar zspecza avatar Carighan avatar Sean Goresht avatar Jackie Ng avatar Peter J Langley avatar Luke Waite avatar Martial Jefferson avatar Nimit Barochia avatar Palani Kumanan avatar Scott Canham avatar Erin Sparling avatar Mahesh Varma avatar Natacha avatar Christian Sherland avatar Adam Bedell avatar Hayato Mizuno avatar Eak Netpanya avatar Eugene Datsky avatar Michael Jackson avatar Andrew avatar Masahiko Okada avatar Danny Tran avatar Michael Anthony avatar AB avatar Daiwei Lu avatar William Bert avatar Rach avatar Justin Sisley avatar Ryan Burgess avatar Alex Lemanski avatar Adam Scott avatar Artur Martins avatar Han Wang avatar Samar Panda avatar Kazuaki Matsuo avatar  avatar creynders avatar Thomas Strobl avatar ucin avatar Kevin Isom avatar Bobby Kostadinov avatar Ryoji Miyazato avatar Robert Loomans avatar Michael Mifsud avatar Andris Sīlis avatar Sean Powell avatar azu avatar Yuya Saito avatar Max Baumann avatar Erin McKean avatar Víctor García avatar Will Sahatdjian avatar Tyler Briles avatar Henri Podolski avatar Ilya Radchenko avatar Kevin Old avatar Francis Au-Yeung avatar Alesei N avatar Ivan Storck avatar Alex Chan avatar Sandro Pasquali avatar Icebob avatar Phil Helm avatar  avatar tejesh avatar Luiz Gonzaga dos Santos Filho avatar David Misshula avatar

Watchers

 avatar  avatar James Cloos avatar Adam Bedell avatar Peran Osborn avatar Michael Anthony avatar Kuber Kaul avatar Mek Stittri avatar Joe Kendall avatar Nam Nguyen avatar Vishaal avatar Ashley Narcisse avatar Jude avatar  avatar

fiveby's Issues

add keywords

automation, selenium, test, testing, webdriver, webdriverjs, mocha, should, bdd, environment, e2e, end-to-end, gulp, har, promise ...

?

should not assigned to variable

This line requires should but doesn't assign it to a variable thus causing any assertions like this to fail:

should.exist(somethingThatShouldExist)

Is there a reason for not assigning a variable to should?

Nemo evaluation

Hi @scott2449 I just watched your presentation at Node Summit. You and I have spent the last few months working on similar products (see: http://nemojs.com)! Given your experience, I'd love to get your feedback on Nemo. If you want to ping me today and meet in person (I'll introduce myself if I see you around), please do! @mattedelman / @nemojs_news (Twitter)

enhance documentation

A living list of things that need to be added to the docs:

  • show local config override
  • show phantom config/usage
  • add something about selendroid and ios-driver

How can I connect to SauceLabs using the fiveby-config.json file?

I am trying to config fiveby to use with SauceLabs, but am not having a lot of success. I’m a bit green, so was wondering if you could point me in the right direction to get me past this.

I tried to use this for the value of hubUrl in my config file, but was getting authentication errors:
“hubUrl”: “http://SAUCE_USERNAME:[email protected]:80/wd/hub”,

If I use SauceConnect and add a gulp task to start SC, then set hubUrl to “http://127.0.0.1:4445”, then I don’t get authentication errors, but the tests fail (the slush generated tests) with error:
“TypeError: undefined is not a function”

What is the proper way to configure this (ideally without having to use SauceConnect)?

formatting standards

add contributing.md and or .editorconfig to help contributors keep things clean

RFC: including selenium jar?

I want it to be easy to start fiveby (and not have to spin up a selenium server separately) but that comes at the cost of having to download the fairly large selenium jar.. maybe we should include a command that will install the jar, check for java, etc.. then in code we can just check for the file as well. And of course none if this is an issue when the dev provides a url.

ChromeDriver Error

When chrome driver is not installed (or on the path) fiveby just skips the tests and "succeeds". It should fail with an explanation.

more detail on rejection of nightwatch

I'm curious about the specific issues that kept you from considering nightwatch in favor of building your own library? I also built a selenium abstraction and get asked a lot about this. For me, the main thing that steered me away from nightwatch was it proscribed a test runner and assertion library. I wanted to have the freedom to choose between mocha, jasmine, or cucumber (just to name some). Also, based on my company's requirements, the parallelization mechanism wasn't flexible enough.

Still, nightwatch is attractive to managers and others who see the nice website, extensive API, and large team of contributors... Curious about your opinion. Thanks!

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.