From 60162cc0b2a60cbca93c7ba237931c5d35ddc243 Mon Sep 17 00:00:00 2001 From: Derek Cameron Date: Sun, 1 Nov 2020 08:26:05 +0900 Subject: [PATCH 1/3] latest changes --- .../Concrete5/Version8/CoreLocators.php | 4 +++ .../Concrete5/Version8/DashboardLocators.php | 2 +- .../Concrete5/Version8/InstallLocators.php | 1 - tests/Dashboard/SiteCest.php | 26 +++++++++++++++++++ tests/_envs/safari.yml | 11 ++++++++ 5 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 tests/Dashboard/SiteCest.php create mode 100644 tests/_envs/safari.yml diff --git a/src/Locators/Concrete5/Version8/CoreLocators.php b/src/Locators/Concrete5/Version8/CoreLocators.php index 73b53f7..77ae986 100644 --- a/src/Locators/Concrete5/Version8/CoreLocators.php +++ b/src/Locators/Concrete5/Version8/CoreLocators.php @@ -16,11 +16,15 @@ class CoreLocators extends BaseCoreLocators protected $toolbar = ['id' => 'ccm-toolbar']; protected $toolbarAddBlock = ['xpath' => '//div[@id="ccm-toolbar"]/ul/li[@data-guide-toolbar-action="add-content"]/a[@data-launch-panel="add-block"]']; protected $toolbarPageSettings = ['xpath' => '//div[@id="ccm-toolbar"]/ul/li[@data-guide-toolbar-action="page-settings"]/a[@data-launch-panel="page"]']; + protected $toolbarLargeTitles = ['xpath'=>'//div[@id="ccm-toolbar"][contains(@class,"large-font")]']; + protected $toolbarReturn = ['xpath'=>'//div[@id="ccm-toolbar"]//a[@data-original-title][child::span[@class="ccm-toolbar-accessibility-title ccm-toolbar-accessibility-title-return"]]']; + protected $toolbarReturnTitle = ['xpath'=>'//div[@id="ccm-toolbar"]//a[@data-original-title]/span[@class="ccm-toolbar-accessibility-title ccm-toolbar-accessibility-title-return"]']; protected $toolbarEdit = ['xpath' => '//div[@id="ccm-toolbar"]/ul/li[@data-guide-toolbar-action="check-in"]/a[@data-toolbar-action="check-in"]']; protected $launchPanel = ['xpath' => '//a[@data-launch-panel="panel"]']; protected $primaryButton = ['xpath' => "//button[contains(@class, 'btn-primary')]"]; protected $systemAlertBox = ['xpath' => "//div[contains(@class,'ccm-system-errors alert')]"]; protected $dismissSystemAlertBox = ['xpath' => "//div[contains(@class,'ccm-system-errors alert')]/button"]; + protected $siteName = ['id' => 'SITE']; protected $loginPage = '/index.php/login'; protected $loginButton = ['xpath' => "//div[contains(@class,'authentication-type')]/form//button"]; protected $editModeActive = ['xpath' => '//div[@id="ccm-toolbar"]//li[contains(@class, \'ccm-toolbar-page-edit-mode-active\')]']; diff --git a/src/Locators/Concrete5/Version8/DashboardLocators.php b/src/Locators/Concrete5/Version8/DashboardLocators.php index d1a0b23..5d800d1 100644 --- a/src/Locators/Concrete5/Version8/DashboardLocators.php +++ b/src/Locators/Concrete5/Version8/DashboardLocators.php @@ -18,7 +18,7 @@ class DashboardLocators extends BaseDashboardLocators protected $dashboardFormLink = ['xpath' => "//div[@class='ccm-dashboard-form-actions-wrapper']/div[@class='ccm-dashboard-form-actions']/a[contains(text(),'button_text')]"]; protected $dashboardFormButton = ['xpath' => "//div[@class='ccm-dashboard-form-actions-wrapper']/div[@class='ccm-dashboard-form-actions']/input[@value='button_text']"]; protected $dashboardPrivacyDialog = ['xpath' => '//button[@data-action="agree-privacy-policy"]']; - + protected $dashboardSubmitButton = ['xpath'=>"//div[@class='ccm-dashboard-form-actions-wrapper']/div[@class='ccm-dashboard-form-actions']/button[@type='submit']"]; /** * {@inheritdoc} */ diff --git a/src/Locators/Concrete5/Version8/InstallLocators.php b/src/Locators/Concrete5/Version8/InstallLocators.php index ba15d80..540ce41 100644 --- a/src/Locators/Concrete5/Version8/InstallLocators.php +++ b/src/Locators/Concrete5/Version8/InstallLocators.php @@ -12,7 +12,6 @@ class InstallLocators extends BaseInstallLocators protected $continueInstallationButton = ['xpath' => "//form[@id='continue-to-installation']/a[contains(@class,'btn-primary')]"]; protected $installButton = ['xpath' => "//div[@class='ccm-install-actions'/button"]; protected $installRedirect = 'index.php/install'; - protected $siteName = ['id' => 'SITE']; protected $startingPointEmpty = ['id' => 'SAMPLE_CONTENT1']; protected $startingPointFull = ['id' => 'SAMPLE_CONTENT2']; protected $databaseServerField = ['id' => 'DB_SERVER']; diff --git a/tests/Dashboard/SiteCest.php b/tests/Dashboard/SiteCest.php new file mode 100644 index 0000000..98e99da --- /dev/null +++ b/tests/Dashboard/SiteCest.php @@ -0,0 +1,26 @@ +login(); + } + + public function setSiteName(AcceptanceTester $I) + { + $I->amOnPage('/index.php/dashboard/system/basics/name'); + $I->fillField($I->getPathFromLocator('siteName'), 'Testing Site'); + $I->clickWithLeftButton($I->getPathFromLocator('dashboardSubmitButton')); + $I->waitForElementVisible($I->getPathFromLocator('resultAlertInfo'), 15); + $I->amOnPage('/index.php'); + $I->wait(2); + $I->canSeeInTitle('Testing Site'); + } + +} \ No newline at end of file diff --git a/tests/_envs/safari.yml b/tests/_envs/safari.yml new file mode 100644 index 0000000..1fed726 --- /dev/null +++ b/tests/_envs/safari.yml @@ -0,0 +1,11 @@ +# `safari` environment config goes here +modules: + config: + Concrete5Browser: + browser: safari + port: 4445 + path: '' + capabilities: + safari.options: + technologyPreview: true + screenResolution: "1920x1080" From 7d3242014c0b4b27d0141ebed64df87aeccb1c27 Mon Sep 17 00:00:00 2001 From: Derek Cameron Date: Sun, 1 Nov 2020 08:35:11 +0900 Subject: [PATCH 2/3] php-cs fixer --- src/Locators/Concrete5/Version8/CoreLocators.php | 6 +++--- src/Locators/Concrete5/Version8/DashboardLocators.php | 3 ++- tests/Dashboard/SiteCest.php | 4 +--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Locators/Concrete5/Version8/CoreLocators.php b/src/Locators/Concrete5/Version8/CoreLocators.php index 77ae986..789ffae 100644 --- a/src/Locators/Concrete5/Version8/CoreLocators.php +++ b/src/Locators/Concrete5/Version8/CoreLocators.php @@ -16,9 +16,9 @@ class CoreLocators extends BaseCoreLocators protected $toolbar = ['id' => 'ccm-toolbar']; protected $toolbarAddBlock = ['xpath' => '//div[@id="ccm-toolbar"]/ul/li[@data-guide-toolbar-action="add-content"]/a[@data-launch-panel="add-block"]']; protected $toolbarPageSettings = ['xpath' => '//div[@id="ccm-toolbar"]/ul/li[@data-guide-toolbar-action="page-settings"]/a[@data-launch-panel="page"]']; - protected $toolbarLargeTitles = ['xpath'=>'//div[@id="ccm-toolbar"][contains(@class,"large-font")]']; - protected $toolbarReturn = ['xpath'=>'//div[@id="ccm-toolbar"]//a[@data-original-title][child::span[@class="ccm-toolbar-accessibility-title ccm-toolbar-accessibility-title-return"]]']; - protected $toolbarReturnTitle = ['xpath'=>'//div[@id="ccm-toolbar"]//a[@data-original-title]/span[@class="ccm-toolbar-accessibility-title ccm-toolbar-accessibility-title-return"]']; + protected $toolbarLargeTitles = ['xpath' => '//div[@id="ccm-toolbar"][contains(@class,"large-font")]']; + protected $toolbarReturn = ['xpath' => '//div[@id="ccm-toolbar"]//a[@data-original-title][child::span[@class="ccm-toolbar-accessibility-title ccm-toolbar-accessibility-title-return"]]']; + protected $toolbarReturnTitle = ['xpath' => '//div[@id="ccm-toolbar"]//a[@data-original-title]/span[@class="ccm-toolbar-accessibility-title ccm-toolbar-accessibility-title-return"]']; protected $toolbarEdit = ['xpath' => '//div[@id="ccm-toolbar"]/ul/li[@data-guide-toolbar-action="check-in"]/a[@data-toolbar-action="check-in"]']; protected $launchPanel = ['xpath' => '//a[@data-launch-panel="panel"]']; protected $primaryButton = ['xpath' => "//button[contains(@class, 'btn-primary')]"]; diff --git a/src/Locators/Concrete5/Version8/DashboardLocators.php b/src/Locators/Concrete5/Version8/DashboardLocators.php index 5d800d1..7a2c5e5 100644 --- a/src/Locators/Concrete5/Version8/DashboardLocators.php +++ b/src/Locators/Concrete5/Version8/DashboardLocators.php @@ -18,7 +18,8 @@ class DashboardLocators extends BaseDashboardLocators protected $dashboardFormLink = ['xpath' => "//div[@class='ccm-dashboard-form-actions-wrapper']/div[@class='ccm-dashboard-form-actions']/a[contains(text(),'button_text')]"]; protected $dashboardFormButton = ['xpath' => "//div[@class='ccm-dashboard-form-actions-wrapper']/div[@class='ccm-dashboard-form-actions']/input[@value='button_text']"]; protected $dashboardPrivacyDialog = ['xpath' => '//button[@data-action="agree-privacy-policy"]']; - protected $dashboardSubmitButton = ['xpath'=>"//div[@class='ccm-dashboard-form-actions-wrapper']/div[@class='ccm-dashboard-form-actions']/button[@type='submit']"]; + protected $dashboardSubmitButton = ['xpath' => "//div[@class='ccm-dashboard-form-actions-wrapper']/div[@class='ccm-dashboard-form-actions']/button[@type='submit']"]; + /** * {@inheritdoc} */ diff --git a/tests/Dashboard/SiteCest.php b/tests/Dashboard/SiteCest.php index 98e99da..ea17407 100644 --- a/tests/Dashboard/SiteCest.php +++ b/tests/Dashboard/SiteCest.php @@ -1,6 +1,5 @@ wait(2); $I->canSeeInTitle('Testing Site'); } - -} \ No newline at end of file +} From a95eb0a7861853173c38ea86d481d299298e5d5d Mon Sep 17 00:00:00 2001 From: Derek Cameron Date: Tue, 26 Oct 2021 20:18:55 +0900 Subject: [PATCH 3/3] update dependencies --- composer.lock | 60 ++++++++++++++++++++++++----------------- tests/_envs/chrome.yml | 5 ++-- tests/_envs/firefox.yml | 2 +- 3 files changed, 40 insertions(+), 27 deletions(-) diff --git a/composer.lock b/composer.lock index f0befbe..1ae6793 100644 --- a/composer.lock +++ b/composer.lock @@ -67,16 +67,16 @@ }, { "name": "codeception/codeception", - "version": "4.1.4", + "version": "4.1.22", "source": { "type": "git", "url": "https://github.com/Codeception/Codeception.git", - "reference": "55d8d1d882fa0777e47de17b04c29b3c50fe29e7" + "reference": "9777ec3690ceedc4bce2ed13af7af4ca4ee3088f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/55d8d1d882fa0777e47de17b04c29b3c50fe29e7", - "reference": "55d8d1d882fa0777e47de17b04c29b3c50fe29e7", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/9777ec3690ceedc4bce2ed13af7af4ca4ee3088f", + "reference": "9777ec3690ceedc4bce2ed13af7af4ca4ee3088f", "shasum": "" }, "require": { @@ -87,8 +87,8 @@ "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", - "guzzlehttp/psr7": "~1.4", - "php": ">=5.6.0 <8.0", + "guzzlehttp/psr7": "^1.4 | ^2.0", + "php": ">=5.6.0 <9.0", "symfony/console": ">=2.7 <6.0", "symfony/css-selector": ">=2.7 <6.0", "symfony/event-dispatcher": ">=2.7 <6.0", @@ -96,17 +96,17 @@ "symfony/yaml": ">=2.7 <6.0" }, "require-dev": { - "codeception/module-asserts": "*@dev", - "codeception/module-cli": "*@dev", - "codeception/module-db": "*@dev", - "codeception/module-filesystem": "*@dev", - "codeception/module-phpbrowser": "*@dev", + "codeception/module-asserts": "1.*@dev", + "codeception/module-cli": "1.*@dev", + "codeception/module-db": "1.*@dev", + "codeception/module-filesystem": "1.*@dev", + "codeception/module-phpbrowser": "1.*@dev", "codeception/specify": "~0.3", "codeception/util-universalframework": "*@dev", "monolog/monolog": "~1.8", "squizlabs/php_codesniffer": "~2.0", "symfony/process": ">=2.7 <6.0", - "vlucas/phpdotenv": "^2.0 | ^3.0 | ^4.0" + "vlucas/phpdotenv": "^2.0 | ^3.0 | ^4.0 | ^5.0" }, "suggest": { "codeception/specify": "BDD-style code blocks", @@ -148,7 +148,17 @@ "functional testing", "unit testing" ], - "time": "2020-03-23T17:07:20+00:00" + "support": { + "issues": "https://github.com/Codeception/Codeception/issues", + "source": "https://github.com/Codeception/Codeception/tree/4.1.22" + }, + "funding": [ + { + "url": "https://opencollective.com/codeception", + "type": "open_collective" + } + ], + "time": "2021-08-06T17:15:34+00:00" }, { "name": "codeception/lib-asserts", @@ -197,25 +207,22 @@ }, { "name": "codeception/module-webdriver", - "version": "1.0.7", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/Codeception/module-webdriver.git", - "reference": "f05c5c25e39d10fbfb2d508779e1537df019ff9b" + "reference": "baa18b7bf70aa024012f967b5ce5021e1faa9151" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/module-webdriver/zipball/f05c5c25e39d10fbfb2d508779e1537df019ff9b", - "reference": "f05c5c25e39d10fbfb2d508779e1537df019ff9b", + "url": "https://api.github.com/repos/Codeception/module-webdriver/zipball/baa18b7bf70aa024012f967b5ce5021e1faa9151", + "reference": "baa18b7bf70aa024012f967b5ce5021e1faa9151", "shasum": "" }, "require": { "codeception/codeception": "^4.0", - "php": ">=5.6.0 <8.0", - "php-webdriver/webdriver": "^1.6.0" - }, - "require-dev": { - "codeception/util-robohelpers": "dev-master" + "php": ">=5.6.0 <9.0", + "php-webdriver/webdriver": "^1.8.0" }, "suggest": { "codeception/phpbuiltinserver": "Start and stop PHP built-in web server for your tests" @@ -248,7 +255,11 @@ "browser-testing", "codeception" ], - "time": "2020-04-01T10:18:18+00:00" + "support": { + "issues": "https://github.com/Codeception/module-webdriver/issues", + "source": "https://github.com/Codeception/module-webdriver/tree/1.4.0" + }, + "time": "2021-09-02T12:01:02+00:00" }, { "name": "codeception/phpunit-wrapper", @@ -3611,5 +3622,6 @@ "platform": { "php": ">=5.5.9" }, - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "2.1.0" } diff --git a/tests/_envs/chrome.yml b/tests/_envs/chrome.yml index c946a55..0998dbc 100644 --- a/tests/_envs/chrome.yml +++ b/tests/_envs/chrome.yml @@ -6,6 +6,7 @@ modules: port: 4444 capabilities: "goog:chromeOptions": - args: ["--headless", "--disable-gpu", "window-size=1920x1080"] - binary: "/usr/bin/google-chrome" + args: [# "--headless", + "--disable-gpu", "window-size=1920x1080"] + # binary: "/usr/bin/google-chrome" window_size: false \ No newline at end of file diff --git a/tests/_envs/firefox.yml b/tests/_envs/firefox.yml index 2673d17..ddd0cbc 100644 --- a/tests/_envs/firefox.yml +++ b/tests/_envs/firefox.yml @@ -8,7 +8,7 @@ modules: capabilities: "moz:firefoxOptions": args: - - "-headless" + # - "-headless" - "-disable-gpu" - "-width=1920" - "-height=1080"