Codeception / Codeception/Codeception

Multiple environment configs left out

Open
#3,290 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
4.9k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

Given the following suite config:

```
sgravel@Rond-point-Wordpress:~/staging$ cat tests/acceptance.suite.yml
# Codeception Test Suite Configuration

# suite for WordPress acceptance tests.
# perform tests in browser using WPBrowser or WPWebDriver modules.

class_name: AcceptanceTester

modules:
enabled:
- Asserts
- MultisiteWPWebDriver
- MultisiteWPDb
- WPConfig
- VisualCeption
- VisualCeptionReporter
- \Helper\Acceptance

env:
default:

desktop:
modules:
config:
MultisiteWPWebDriver:
window_size: 1200x1920
VisualCeption:
referenceImageDir: tests/acceptance/ReferenceImages/desktop/
currentImageDir: tests/acceptance/CurrentImages/desktop/
VisualCeptionReporter:
logFile: tests/_output/desktop-vcreport.html
tablet:
modules:
config:
MultisiteWPWebDriver:
window_size: 768x1024
VisualCeption:
referenceImageDir: tests/acceptance/ReferenceImages/tablet/
currentImageDir: tests/acceptance/CurrentImages/tablet/
VisualCeptionReporter:
logFile: tests/_output/tablet-vcreport.html
phone:
modules:
config:
MultisiteWPWebDriver:
window_size: 320x568
VisualCeption:
referenceImageDir: tests/acceptance/ReferenceImages/phone/
currentImageDir: tests/acceptance/CurrentImages/phone/
VisualCeptionReporter:
logFile: tests/_output/phone-vcreport.html

firefox:
modules:
config:
MultisiteWPWebDriver:
browser: 'firefox'
port: 4444`
```

Running the following command doesn't take the VisualCeption configs into account (Notice the reference and current directory for image comparison not matching the config towards the end):

```
sgravel@Rond-point-Wordpress:~/staging$ ./wpcept run acceptance ResponsiveUICest --debug --env phone,firefox
Codeception PHP Testing Framework v2.2.1
Powered by PHPUnit 5.4.6 by Sebastian Bergmann and contributors.

Dump file domain [http://localhost:8081] replaced with [http://lrpdev.lerondpoint.net]
Tried to replace WordPress site domain but dump file does not contain a table INSERT instruction for table [blogs].
Tried to replace WordPress site domain but dump file does not contain a table INSERT instruction for table [site].
Initializing VisualCeptionReport
VisualCeptionReporter: templateFile = /var/www-staging/vendor/digital-products-fork/codeception-visualception-wpbrowser/module/report/template.php

Acceptance (phone, firefox) Tests (4) -------------------------------------------------------------------------
Modules: Asserts, MultisiteWPWebDriver, MultisiteWPDb, WPConfig, VisualCeption, VisualCeptionReporter, \Helper\Acceptance
---------------------------------------------------------------------------------------------------------------
ResponsiveUICest: Options visual regression
Signature: ResponsiveUICest:optionsVisualRegression
Test: tests/acceptance/ResponsiveUICest.php:optionsVisualRegression
Scenario --
I login as admin
[GET] http://lrpdev.lerondpoint.net/wp-login.php
Cookies matching pattern /^wordpress_[a-z0-9]{32}$/ : {"wordpress_7f723edce82d89be540d791a37b0558d": "jenkins%7C1467321940%7CUXGLVBQR1WrIVzLpD71LxEGqiwuGeAdNr2lZpb82VfK%7C8143afa82ba3bdbb579692c651ec17b258c275e807d74c856b547e5e68508c26"}
Cookies matching pattern /^wordpress_logged_in_[a-z0-9]{32}$/ : {"wordpress_logged_in_7f723edce82d89be540d791a37b0558d": "jenkins%7C1467321940%7CUXGLVBQR1WrIVzLpD71LxEGqiwuGeAdNr2lZpb82VfK%7Caeeb859b7211d67ecc051b318c67b48793df71b73e74a54f0e107f8ba3437189"}
I grab prefixed table name for "options"
I have or update in database "wp_options",{"option_name":"gaep_access_token","option_value":"{\"access_tok...}
[Query] INSERT INTO `wp_options` (`option_name`, `option_value`) VALUES (?, ?) ON DUPLICATE KEY UPDATE option_name='gaep_access_token', option_value='{"access_token":"ya29.CjUPAw8NYOm8r2cV24vdxacMeej_rGjfOEZ4aF9l2jh0MyPjX6HsuOItUjqFh9mTA10GtwNzxQ","expires_in":3600,"created":1467149142}'
I have or update in database "wp_options",{"option_name":"gaep_linked_account","option_value":"73314709"}
[Query] INSERT INTO `wp_options` (`option_name`, `option_value`) VALUES (?, ?) ON DUPLICATE KEY UPDATE option_name='gaep_linked_account', option_value='73314709'
I have or update in database "wp_options",{"option_name":"gaep_linked_property","option_value":"UA-7331470...}
[Query] INSERT INTO `wp_options` (`option_name`, `option_value`) VALUES (?, ?) ON DUPLICATE KEY UPDATE option_name='gaep_linked_property', option_value='UA-73314709-1'
I am on admin page "admin.php?page=gaep_auth"
[GET] http://lrpdev.lerondpoint.net/wp-admin/admin.php?page=gaep_auth
I don't see visual changes "OptionsScreen",null,null,[".update-nag"]
set display of element '.update-nag' to 'none'
removed display override of element '.update-nag'
Trying to compare tests/acceptance/ReferenceImages/OptionsScreen.png with tests/acceptance/CurrentImages/OptionsScreen.png
The deviation between the images is 0 percent
PASSED
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.