Coder Social home page Coder Social logo

2.5-assessment's Introduction

2.5 Assessment - Automation Basics

Setup

Fork this repository, clone it to your computer, and then cd into the repository folder. As usual, npm i will install the needed dependencies and npm start will run the app. You'll need to open a second terminal to run your tests using the nightwatch command.

Your Assessment

This project includes several small pieces of functionality. We will be testing all of them! Remember that to set up your testing, you can:

  1. Copy and paste an existing nightwatchProps.js
  2. Create your test framework, usually a "tests" or "nightwatch" folder in the repository's base directory, and testing/resource folders inside of that.
    • The existing nightwatch.conf.js file is expecting your tests to be in a nightwatch/tests folder; if you wanted to do something different, you are more than welcome to, but don't forget to update the "src_folders" property of the nightwatch.conf.js file appropriately.
  3. Plan WHAT should be tested
    • Start with one test for each piece of functionality and get as far as you can, before you worry about testing the same piece multiple ways.
  4. Plan HOW you can test these items
    • You can pop this information out into JIRA if it will be helpful for you, but that is not required for this assessment
  5. Gather selectors. I do want to see a selectors file for this step
  6. What test data will you need? You can but don't have to have a separate file for the test data
  7. Start writing!

If you aren't sure where to get started, an easy way to organize your tests is to write your steps in comments, and then in code.

For example, based on the Odds and Evens bit of functionality:

    'Odds and Evens' : browser => {
        //input numbers

        //click sort button

        //check even output

        //check odd output

    }

Helpful NightwatchJS Commands

  • .click() - we'll use this one
  • .setValue() - we'll set that for sure
  • .expect.element().text.to.equal() - just like testing the calculator...
  • .expect.element().text.to.contain() - works exactly the same as the above, except that it looks for something to appear SOMEWHERE in the element's text, not for an exact match. ({hello: 'world', goodnight: 'moon'} could have a match for "hello" or "moon" if we used this command)

Look at the NightwatchJS API docs for more details.

Functionality

Odds and Evens

This field will take a string of numbers and sort them into odd and even outputs.

Filter Object

These objects can be filtered by entering any of their properties. Only objects with that property will appear in the results.

Filter String

From the listed strings, only those containing the string you input will appear in the results.

Palindrome

Click the button to see whether the string you entered is, or is not, a palindrome.

Sum

On the input lines, put in two numbers, click the button to see their sum.

Contributions

If you see a problem or a typo, please fork, make the necessary changes, and create a pull request so we can review your changes and merge them into the master repo and branch.

Copyright

© DevMountain LLC, 2017. Unauthorized use and/or duplication of this material without express and written permission from DevMountain, LLC is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to DevMountain with appropriate and specific direction to the original content.

2.5-assessment's People

Contributors

devlemire avatar

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.