From ad5ef4f8049395a14bf5b25dd05e1e976e397517 Mon Sep 17 00:00:00 2001 From: Peter Cottle Date: Sat, 11 Apr 2015 14:30:50 -0700 Subject: [PATCH] more command test --- src/__tests__/casperjs/command_view_test.js | 38 ++++++--------------- 1 file changed, 11 insertions(+), 27 deletions(-) diff --git a/src/__tests__/casperjs/command_view_test.js b/src/__tests__/casperjs/command_view_test.js index 053805c1..b6c25202 100644 --- a/src/__tests__/casperjs/command_view_test.js +++ b/src/__tests__/casperjs/command_view_test.js @@ -15,36 +15,20 @@ CasperUtils.start( '#command_c32 div.commandLineResult p', 'The command "asd" isn\'t supported, sorry!' )) - /* + .then(CasperUtils.enterCommand('git commit')) + .wait(100) + .then(CasperUtils.asserts.selectorContainsText( + '#command_c34 p.commandLine span:nth-child(2)', + 'git commit' + )) + .wait(700) .then(CasperUtils.enterCommand('git checkout C1')) - .wait(800) - .then(CasperUtils.asserts.selectorContainsText( - 'div.modalView.inFront div.displayName h3', - 'Introduction Sequence' - )) - .then(CasperUtils.asserts.selectorContainsText( - 'div.modalView.inFront div.seriesView p', - "A nicely paced introduction to the majority of git commands" - )) - .then(function() { - this.page.sendEvent('keypress', this.page.event.key.Right); - }) - .wait(700) - .then(CasperUtils.screenshot.entirePage) - // Now we have selected the first level - .then(CasperUtils.asserts.selectorContainsText( - 'div.modalView.inFront div.seriesView p', - "Introduction to Git Commits" - )) - .then(function() { - this.page.sendEvent('keypress', this.page.event.key.Enter); - }) - .wait(700) + .then(CasperUtils.enterCommand('git commit')) + .wait(2000) .then(CasperUtils.screenshot.entirePage) .then(CasperUtils.asserts.selectorContainsText( - 'div.levelNameWrapper', - "Level Introduction to Git Commits" + '#commandDisplay div.commandLineWarnings p span', + "Warning!! Detached HEAD state" )) - */ .then(CasperUtils.testDone); }).run();