A QA Engineer walks into a bar. Orders a beer. Orders 0 beers. Orders 999999999 beers. Orders a lizard. Orders -1 beers. Orders a sfdeljkn.
When I’m finally in charge, two of my first mandates will be: If you’re driving in the left lane, BE passing. But only slightly less important will be: “Please read Mythical Man Month”.
And you don’t even have to read the book if you don’t want. Simply read the Wiki page about the book and believe it. In fact, you can skip the book and the Wiki page if you’ll repeat the following three times, out loud:
“Adding manpower to a late software project makes it later”.
You may now become a manager…
Having a server in the cloud is a nicety. That Amazon gives you one free for a year to tinker with… that’s being downright friendly!
The following are some notes/howtos for setting up an Ubuntu Amazon EC2 instance. I post them to help me remember them but they might also be useful to others…
Allow SSH Access
If you’d prefer to just ssh into your instance instead of using key/pair…
1. Login using the key/pair you created when setting up your EC2 instance:
ssh -i myprivatekey.pem [email protected]
2. edit your sshd_config file and uncomment and/or set
sudo pico /etc/ssh/sshd_config
3. Reload SSH:
sudo reload ssh
4. Create a new user and set the user’s password:
useradd NAME passwd // enter password twice...
1. Update Ubuntu’s package database, install and run Taskel. Select the LAMP server (don’t deselect anything that is also checked) and let it install:
sudo apt-get update sudo tasksel
2. Install PHPMyAdmin; select
Apache2, enter a root password and say
No to config the database later:
sudo apt-get install phpmyadmin
3. Verify by going to: http://myIPaddress/phpmyadmin and login as root with the password you entered. Of course you’ll probably want to secure/move this!
Install XRDP on Ubuntu 12.10
Installing X11 on your instance–should you be so inclined–may prove tricky… I tried MANY ways of doing it (OpenBox/FluxBox, VNC, etc…) but each attempt ended in failure. I found victory with XRDP!
1. Found from the instructions here. First install Gnome (will take a while)…
export DEBIAN_FRONTEND=noninteractive sudo apt-get update sudo apt-get install -y ubuntu-desktop
2. Ubuntu 12.10 no longer includes gnome-session-2d, so install fallback and edit .xession to use it:
sudo apt-get install gnome-session-fallback pico .xsession gnome-session --session=gnome-fallback // add/change this line in .xession /etc/init.d/xrdp restart
3. Edit Xwrapper file and set
4. Create a new Security Group Rule for
RDP(i.e. open port 590x (where x is the vncserver id))
5. Install RDP client on your local machine…
Install Chromium brownser on Ubuntu 12.10
FireFox is in need of Unity by default and it appears it doesn’t exist on 12.10. I wanted Chrome on there anyway but it didn’t work either. Chromium does:
sudo apt-get install chromium-browser
I’m looking forward to attending this year’s Google Test Automation Conference (GTAC) in New York!
I recently found a bug when sorting table columns, while running IE9. Ignoring the obvious fix, I wrote up the bug and then as I’m a fan of doing, I wrote a failing automated test to test it (Defect Driven Development!).
Testing sort proved a bit tricky… I thought I would share the results to perhaps save others same pain. I would also not be surprised to find a more elegant solution out there. If you have one, do feel free to share!
My example is in Sahi but it should be easy to transfer to your tool of choice. The gist is:
- Sort your column
- Collect all the elements in the column in an array
- Compare the two arrays
And here’s the Sahi code…
Name table header to get our initial sort of that column.
Then we collect each element in the
Name column, in
table0 and store them in an array,
$appSortedValues. To iterate through our loop, we get the number of rows in
table0 by counting the number of rows and subtract 1 for each table header.
Now we need a copy of our
$jsSortedValues = $appSortedValues; . This will actually create a reference to our original array; not what we want. Instead we use the
slice() method to select elements 0 through the end of the array and put them all in our new array, thus copying it.
sort() method to sort the copy of our array,
$jsSortedValues. But the
sort() method has a little wrinkle; by default, it sorts alphabetically and is case sensitive. This is unlikely to be how your application’s sort works… but luckily, you can roll your own sort filter by passing a function as an argument to the
sort() method. In our case, we want it to be case-insensitive, hence our function
Now we have two arrays and can simply use Sahi’s _assertEqual method to verify both arrays are sorted in the same order.