Refactor action test
Fix minor bug in Selenium test