Skip to main content

Posts

Javascript send text function

Simple send text function that you could use for front end tests within a browser. Replacing the value is quite easy with standard Javascript, however the DOM does not realize that the value has changed. For instance lets say you had an input field that is required to be filled in. If you just change the value by its self it will never remove the required message. To complete this we fire off a change event. function sendText(id, val) { //find the element var el = document.getElementById(id); //replace the value of the element with val el.value = val; //create an event to let the DOM know something changed. var event = new Event('change'); //fire off the event el.dispatchEvent(event); }

Display Guitar Chords on webpage

Sometimes its nice to have a handy tool for displaying different chords on a web page. For instance lets say that you want to show off some lyrics with chords to teach someone a song. I created ChordTab to have a simple way to display those chords. Code Sample <style> svg { width: 100px; } </style> <c-tab chord="g" instrument="guitar"> <script src="https://gitcdn.xyz/repo/blh0021/chordTab/master/src/tab.min.js"></script> Sample Chord Other Instruments In addition to guitar, you can also change the instrument attribute to mandolin, ukulele, or banjo. Currently not every chord has been created data wise but work is being done all the time.

Protractor getText from hidden element.

Ran across a point that I wanted to get the value of a hidden element while running my Protractor tests. getText() function was not helpful at all. In order for it to return text it has to be visible. There is an option called getAttribute('textContent'). This will allow you to always return the text. Sample HTML <span style="display: none" name="hiddenSpan">Hidden Text</span> Sample Protractor JS $('[name="hiddenSpan"]').getText(); // returns "" $('[name="hiddenSpan"]').getAttribute('textContent'); // returns "Hidden Text"

Get a little Rusty

Been playing around with Rust lang and I have to say I am starting to really enjoy it as a low level programming language.  Its kinda cool to have some modern functionality from the beginning.  Now as a software developer I can get excited but what about being a test developer.  One should probably think those are the same thing.  Well I wont start up that argument but I tend to believe they are one in the same. Lets do some basic coding. We can create us a new library called test_example. $ cargo new test_example This will create you a basic structure for a project. Included will be a src directory. Underneath that you will see lib.rs. You can open this up in your favorite text editor and see something that looks like. #[cfg(test)] mod test { #[test] fn it_works() { } } So you could run this right now and get some passing tests. $ cargo test Lets simplify what we are looking a little more. Change your lib.rs to look like. pub fn truthy(...

I-Team vs We-Team

Agile Agile Agile....  The loudest buzzword of many I get to hear lately.  Even though we hear it does it actually sink in to our everyday practices.  So many seem to know the Agile Manifesto to heart, and also the 12 principles.  What is interesting to me in working in some of the teams is that even though we call our team an agile team, it still acts like the old waterfall project work. I could spell out many reasons why I see conflicts that inject a lot of churn within the team.  However the biggest and I believe root cause is the word TEAM itself.   For instance within your own group have you ever said or heard something like, "we all should be responsible for the outcome"?  Then when someone is asked to do something a little outside their comfort zone they get mad or offensive and say "That is not my job", or "I do not feel qualified to do that." This is what I like to call the I-Team.  Or Individual Team.  In General these p...

Juniper VPN using OpenConnect

Finally there is a tool worth using for vpn besides the default from Juniper that works on Linux. Its rather quick to get started. Install Arch $ pacman -S openconnect Install Ubuntu $ apt-get install openconnect Install Fedora/RedHat $ dnf install openconnect or this if you have older Fedora/RedHat $ yum install openconnect Once you have it installed you may need to reboot. This will allow proper access to /dev/net/tun Run it $ openconnect --juniper vpn.domain.com

I'll Fly Away - Lyrics and Chords

VERSE 1: G Some glad morning when this life is o'er, C I'll fly away G To a home on God's celestial shore, C I'll fly away CHORUS: G I'll fly away, O glory, C I'll fly away G In the morning. G When I die, E hallelujah, by and by G I'll D I'll fly away VERSE 2: G When the shadows of this life have grown, C I'll fly away G Like a bird from prison bars has flown, C I'll fly away VERSE 3: G Just a few more weary days, and then, C I'll fly away G To a land where joys shall never end, C I'll fly away