Codeception icon indicating copy to clipboard operation
Codeception copied to clipboard

Multiple environment configs left out

Open LRP-sgravel opened this issue 8 years ago • 4 comments

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

LRP-sgravel avatar Jun 28 '16 21:06 LRP-sgravel

Sorry didn't have a chance to look into your issue.

But it's nice to see you are using VisualCeption and I saw your PR there. Looks like the project is abandoned by its authors and I plan to get it into Codeception organization. Would you be interested to maintain it?

DavertMik avatar Jun 29 '16 00:06 DavertMik

Actually, yes. I proposed that today in an VC issue I fixed in my fork. I also quickly started a similar project for Xamarin.UITest but quickly put it aside because I've been busy elsewhere..

LRP-sgravel avatar Jun 29 '16 02:06 LRP-sgravel

Here : https://github.com/DigitalProducts/codeception-module-visualception/issues/23

LRP-sgravel avatar Jun 29 '16 14:06 LRP-sgravel

What's the state of this issue?

Naktibalda avatar Jan 10 '21 17:01 Naktibalda