From 2eed7b082f83630301e51f57ca8394de228a8605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Sun, 18 Aug 2019 21:14:58 -0500 Subject: first commit --- tests/phpunit/selenium/openbay/SetupTest.php | 91 ++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 tests/phpunit/selenium/openbay/SetupTest.php (limited to 'tests/phpunit/selenium/openbay') diff --git a/tests/phpunit/selenium/openbay/SetupTest.php b/tests/phpunit/selenium/openbay/SetupTest.php new file mode 100644 index 0000000..831a891 --- /dev/null +++ b/tests/phpunit/selenium/openbay/SetupTest.php @@ -0,0 +1,91 @@ +setBrowser('firefox'); + $this->setBrowserUrl(HTTP_SERVER); + } + + /** + * @after + */ + protected function completeTest() { + + } + + public function testSetup() { + if ($this->moduleInstalled === false) { + $this->url("admin/"); + + $this->byCssSelector('input[name="username"]')->click(); + $this->keys(ADMIN_USERNAME); + + $this->byCssSelector('input[name="password"]')->click(); + $this->keys(ADMIN_PASSWORD); + + $this->byCssSelector('button[type="submit"]')->click(); + + $this->moduleInstalled = true; + + $this->waitToLoad('Dashboard'); + + // Installing the payment module + $this->clickOnElement('button-menu'); + + $this->waitToAppearAndClick('#extension a'); + $this->waitToAppearAndClick('#extension li:nth-child(3) a'); + + $this->waitToLoad('Modules'); + + $i = 1; + + for ( ; ; $i++) { + $element = $this->byCssSelector(".table-striped tbody tr:nth-child($i) td:first-child"); + + if ($element->text() == 'OpenBay Pro') { + break; + } + } + + $this->waitToAppearAndClick(".table-striped tbody tr:nth-child($i) td:last-child a.btn-success"); + + $this->waitToLoad('Modules', 50000); + + // Go to the OpenBay Pro dashboard + $this->waitToAppearAndClick('#extension li:nth-child(8) a'); + $this->waitToAppearAndClick('#extension li:nth-child(8) li:first-child a'); + + $this->waitToLoad('OpenBay Pro', 50000); + + $this->byCssSelector('#button-install-ebay')->click(); + + $this->waitToLoad('OpenBay Pro', 50000); + + $this->byCssSelector('#button-edit-ebay')->click(); + + $this->waitToLoad('Dashboard', 50000); + + $this->byCssSelector('#settings-link')->click(); + + $this->waitToLoad('Marketplace settings', 50000); + + $this->byCssSelector('#ebay-status option[value="1"]')->click(); + + $this->clickOnElement('ebay-token'); + $this->keys(OPENBAY_EBAY_TOKEN); + + $this->clickOnElement('ebay-secret'); + $this->keys(OPENBAY_EBAY_SECRET); + + $this->byCssSelector('button[type="submit"]')->click(); + } + } + + public function installEbay() { + + } +} -- cgit v1.2.3