3 namespace Zumba\GastonJS\Tests;
6 * Class BrowserNavigateTest
7 * @package Zumba\GastonJS\Tests
9 class BrowserNavigateTest extends BrowserCommandsTestCase {
11 public function testBrowserVisit() {
12 $this->visitUrl($this->getTestPageBaseUrl() . "/static/basic.html");
15 public function testBrowserCurrentUrl() {
16 $this->visitUrl($this->getTestPageBaseUrl() . "/static/basic.html");
17 $currentUrl = $this->browser->currentUrl();
18 $this->assertEquals($this->getTestPageBaseUrl() . "/static/basic.html", $currentUrl);
21 public function testBrowserReload() {
22 $this->visitUrl($this->getTestPageBaseUrl() . "/static/basic.html");
23 $this->assertTrue($this->browser->reload());
24 $currentUrl = $this->browser->currentUrl();
25 $this->assertEquals($this->getTestPageBaseUrl() . "/static/basic.html", $currentUrl);
28 public function testGoBack() {
29 //We have a clean slate so the first try should say no
30 $this->assertFalse($this->browser->goBack());
31 $this->testBrowserVisit();
32 //First visit still needs to be false
33 $this->assertFalse($this->browser->goBack());
34 $this->visitUrl($this->getTestPageBaseUrl() . "/static/auth_ok.html");
35 $this->assertTrue($this->browser->goBack());
36 $this->assertEquals($this->getTestPageBaseUrl() . "/static/basic.html", $this->browser->currentUrl());
39 public function testGoForward() {
40 //We have a clean slate so the first try should say no
41 $this->assertFalse($this->browser->goForward());
42 $this->testBrowserVisit();
43 //Still can not go forward
44 $this->assertFalse($this->browser->goForward());
45 $this->visitUrl($this->getTestPageBaseUrl() . "/static/auth_ok.html");
46 //Now we can go back and forward
47 $this->assertTrue($this->browser->goBack());
48 $this->assertTrue($this->browser->goForward());
49 $this->assertEquals($this->getTestPageBaseUrl() . "/static/auth_ok.html", $this->browser->currentUrl());