Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functional Tests Updated #1448

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions test/selenium/PmaSeleniumCreateRemoveUserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function testCreateRemoveUser()
$this->byId("createdb-1")->click();
$this->byId("createdb-2")->click();
$this->byId("addUsersForm_checkall")->click();
$this->byName("adduser_submit")->click();
$this->byId("adduser_submit")->click();

$success = $this->waitForElement("byCssSelector", "div.success");
$this->assertContains('You have added a new user', $success->text());
Expand All @@ -92,8 +92,11 @@ public function testCreateRemoveUser()
)->click();

$this->byId("checkbox_drop_users_db")->click();
$this->acceptAlert();
$this->byId("buttonGo")->click();
$this->byXPath(
"//*[contains(text(), 'OK')]"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that a more specific XPath here will be good as this will select all tags containing text "OK" and will attempt to click it.

)->click();
$this->acceptAlert();

$success = $this->waitForElement("byCssSelector", "div.success");
$this->assertContains(
Expand Down
7 changes: 6 additions & 1 deletion test/selenium/PmaSeleniumTableCreateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public function testCreateTable()

$column_dropdown_details = array(
"field_0_6" => "UNSIGNED",
"field_0_8" => "PRIMARY",
"field_1_2" => "VARCHAR",
"field_1_5" => "utf8_general_ci",
"field_1_4" => "As defined:"
Expand All @@ -65,6 +64,12 @@ public function testCreateTable()
$sel->selectOptionByLabel($value);
}

// To handle the dialogbox opened after selecting PRIMARY
$this->select($this->byId('field_0_8'))->selectOptionByLabel('PRIMARY');
$this->byXPath(
"//*[contains(text(), 'Go')]"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here as well

)->click();

$this->byName("field_default_value[1]")->value("def");
$this->byId("field_0_9")->click(); // auto increment
$this->byId("field_1_7")->click(); // null
Expand Down
2 changes: 1 addition & 1 deletion test/selenium/PmaSeleniumTableInsertTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function testAddData()
private function _assertDataPresent()
{
$this->byLinkText("Browse")->click();
$this->waitForElement("byId", "table_results");
$this->waitForElement("byClassName", "table_results");

$this->assertEquals(
"1",
Expand Down
3 changes: 3 additions & 0 deletions test/selenium/TestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ protected function setUp()
$this->dbQuery(
'USE ' . $this->database_name
);

// Maximize the window size
$this->prepareSession()->currentWindow()->maximize();
}

/**
Expand Down