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

devops: e2e modules locked to Codeception v4 until conflicts with WPBrowser resolved. #37

Merged
merged 10 commits into from
May 21, 2024
2 changes: 1 addition & 1 deletion .github/workflows/continous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
codeception/module-phpbrowser:* \
codeception/module-webdriver:* \
wp-cli/wp-cli-bundle \
lucatume/wp-browser:^4
"lucatume/wp-browser:>3.1 <3.5" \

- name: Run Codeception Tests w/ Docker.
env:
Expand Down
14 changes: 7 additions & 7 deletions codeception.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ extensions:
enabled:
- Codeception\Extension\RunFailed
commands:
- "lucatume\\WPBrowser\\Command\\GenerateWPUnit"
- "lucatume\\WPBrowser\\Command\\GenerateWPRestApi"
- "lucatume\\WPBrowser\\Command\\GenerateWPRestController"
- "lucatume\\WPBrowser\\Command\\GenerateWPRestPostTypeController"
- "lucatume\\WPBrowser\\Command\\GenerateWPAjax"
- "lucatume\\WPBrowser\\Command\\GenerateWPCanonical"
- "lucatume\\WPBrowser\\Command\\GenerateWPXMLRPC"
- Codeception\Command\GenerateWPUnit
- Codeception\Command\GenerateWPRestApi
- Codeception\Command\GenerateWPRestController
- Codeception\Command\GenerateWPRestPostTypeController
- Codeception\Command\GenerateWPAjax
- Codeception\Command\GenerateWPCanonical
- Codeception\Command\GenerateWPXMLRPC
params:
- .env.testing
- .env.docker
8 changes: 4 additions & 4 deletions src/Codeception/Module/WPGraphQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ class WPGraphQL extends Module {
/**
* @var array<string, string>
*/
protected array $config = [
protected $config = [
'endpoint' => '',
'auth_header' => '',
];

protected array $requiredFields = [
protected $requiredFields = [
'endpoint',
];

Expand Down Expand Up @@ -109,7 +109,7 @@ protected function parseRequestOptions( array $selected_options ) {
* Sends a GET request to the GraphQL endpoint and returns a response
*
* @param string $query The GraphQL query to send.
* @param array $selected_options Selected options to control various aspects of a request.
* @param ?array $selected_options Selected options to control various aspects of a request.
*
* @throws \Codeception\Exception\ModuleException Invalid endpoint | Invalid query.
*
Expand Down Expand Up @@ -145,7 +145,7 @@ public function getRawRequest( string $query, array $selected_options = [] ) {
* Sends a GET request to the GraphQL endpoint and returns the query results
*
* @param string $query The GraphQL query to send.
* @param array $selected_options Selected options to control various aspects of a request.
* @param ?array $selected_options Selected options to control various aspects of a request.
*
* @throws \Codeception\Exception\ModuleException Invalid response | Empty response.
*
Expand Down
8 changes: 4 additions & 4 deletions tests/codeception/acceptance.suite.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
actor: AcceptanceTester
modules:
enabled:
- \lucatume\WPBrowser\Module\WPDb
- \lucatume\WPBrowser\Module\WPBrowser
- WPDb
- WPBrowser
- \Helper\Acceptance
config:
\lucatume\WPBrowser\Module\WPDb:
WPDb:
dsn: '%TEST_SITE_DB_DSN%'
user: '%TEST_DB_USER%'
password: '%TEST_DB_PASSWORD%'
Expand All @@ -24,7 +24,7 @@ modules:
urlReplacement: true
tablePrefix: '%TEST_TABLE_PREFIX%'

\lucatume\WPBrowser\Module\WPBrowser:
WPBrowser:
url: '%TEST_SITE_WP_URL%'
wpRootFolder: '%WP_ROOT_FOLDER%'
adminUsername: '%TEST_SITE_ADMIN_USERNAME%'
Expand Down
12 changes: 6 additions & 6 deletions tests/codeception/functional.suite.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ actor: FunctionalTester
modules:
enabled:
- Asserts
- \lucatume\WPBrowser\Module\WPDb
- \lucatume\WPBrowser\Module\WPBrowser
- \lucatume\WPBrowser\Module\WPFilesystem
- WPDb
- WPBrowser
- WPFilesystem
- \Tests\WPGraphQL\Codeception\Module\QueryAsserts
- \Tests\WPGraphQL\Codeception\Module\WPGraphQL
- \Helper\Functional
config:
\Tests\WPGraphQL\Codeception\Module\WPGraphQL:
endpoint: '%TEST_SITE_WP_URL%/graphql'
auth_header: 'Basic %TEST_SITE_ADMIN_APP_PASSWORD%'
\lucatume\WPBrowser\Module\WPDb:
WPDb:
dsn: '%TEST_SITE_DB_DSN%'
user: '%TEST_DB_USER%'
password: '%TEST_DB_PASSWORD%'
Expand All @@ -29,14 +29,14 @@ modules:
urlReplacement: true
tablePrefix: '%TEST_TABLE_PREFIX%'

\lucatume\WPBrowser\Module\WPBrowser:
WPBrowser:
url: '%TEST_SITE_WP_URL%'
wpRootFolder: '%WP_ROOT_FOLDER%'
adminUsername: '%TEST_SITE_ADMIN_USERNAME%'
adminPassword: '%TEST_SITE_ADMIN_PASSWORD%'
adminPath: '/wp-admin'

\lucatume\WPBrowser\Module\WPFilesystem:
WPFilesystem:
wpRootFolder: '%WP_ROOT_FOLDER%'
plugins: '/wp-content/plugins'
mu-plugins: '/wp-content/mu-plugins'
Expand Down
4 changes: 2 additions & 2 deletions tests/codeception/wpunit.suite.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
actor: WpunitTester
modules:
enabled:
- \lucatume\WPBrowser\Module\WPLoader
- WPLoader
- \Helper\Wpunit
config:
\lucatume\WPBrowser\Module\WPLoader:
WPLoader:
wpRootFolder: "%WP_ROOT_FOLDER%"
dbName: "%TEST_DB_NAME%"
dbHost: "%TEST_DB_HOST%"
Expand Down
Loading