Posts

Git Cheat Sheet

This Git Cheat Sheet is a work in progress . If you'd like to suggest an addition then please comment below. Passwords Update your password when it changes .. an easy way which prompts for your new password git pull Ignoring files and directories Place a .gitignore file in your top level directory with one entry per row e.g. test_output Whenever a directory called "test_output" is found, git will not consider it for changes. Branches View all the local branches git branch View all the remote branches git branch -r View all the remote AND local branches git branch -a Switch to the branch <branch-name> git checkout <branch-name> Find out branch you are on git branch (* row in results denotes the current branch) Stashing View all the stashes git stash list Stash changes git stash / git stash save  Restore a stash that was not the last one stashed (need to manually remove from the list) git

Sending Special Keys to Elements with Protractor sendKeys()

It is pretty straight-forward from the examples on the web how to send alphanumeric keystrokes to an element with protractor.  It gets a bit trickier if you want to send a special key.  If you are lucky you will find a forum post with the key you are after. I wanted to send a right-arrow key and couldn't find anything on the Protractor site or in any forum posts. I searched for ages before I found this lifesaving webpage.  It lists the constants for all the special keys. Find the constant name in this webpage and then prepend " protractor.Key. " to it. https://gist.github.com/boxmein/f86b6e196d3c0c472f302c80f7388704 So to send the right arrow key to an input field (useful for editing an input with existing content) .. element(by.tagName('input')).sendKeys(protractor.Key.ARROW_RIGHT);