Skip to content
This repository has been archived by the owner on Nov 21, 2023. It is now read-only.

Replace baseUrl test page with one generated by WP CLI #72

Open
dotherightthing opened this issue Oct 6, 2019 · 2 comments
Open

Replace baseUrl test page with one generated by WP CLI #72

dotherightthing opened this issue Oct 6, 2019 · 2 comments

Comments

@dotherightthing
Copy link
Owner

dotherightthing commented Oct 6, 2019

See $this->create_attachment, in tests/test-wpdtrt-gallery.php, which uses PHPUnit, wp-cli, WP_UnitTestCase.

This should be faster than loading a WordPress page, which has many other all plugins active, potential unreleased changes to themes and plugins etc (urgh).

@dotherightthing dotherightthing self-assigned this Oct 6, 2019
@dotherightthing dotherightthing changed the title Replace baseUrl test page with one generated by phpUnit Replace baseUrl test page with one generated by WP CLI Oct 6, 2019
@dotherightthing dotherightthing pinned this issue Oct 6, 2019
@dotherightthing
Copy link
Owner Author

dotherightthing commented Oct 8, 2019

Cypress fails to run cy.visit(), due to hardcoded example.org values in /var/folders/0y/xxxxxxxx/T/wordpress-tests-lib/wp-tests-config.php:

Replacing example.org with localhost, 127.0.0.1 or somelocalvirtualhost does not help:

dotherightthing added a commit to dotherightthing/wpdtrt-plugin-boilerplate that referenced this issue Oct 10, 2019
dotherightthing added a commit to dotherightthing/wpdtrt-plugin-boilerplate that referenced this issue Oct 10, 2019
dotherightthing added a commit to dotherightthing/wpdtrt-plugin-boilerplate that referenced this issue Oct 10, 2019
* development:
  Bump version
  Fix Bash conditionals
  Only install Natural Docs if the folder is not already present (fixes #172)
  Don't install Mono on CI on dev branch (#173)
  Disable example.org rewrite as it doesn't solve dotherightthing/wpdtrt-gallery#72
  Exclude PHPDoc sniffs
  Ignore VS code extension settings
  Don't install Natural Docs & Mono on CI on dev branch
  Allow node_modules 'src' folders (fixes #175)
  Replace example.org with localhost, to allow Cypress to test pages in the temporary WordPress site (dotherightthing/wpdtrt-gallery#72)
  Docs
  Use the local PHPUnit XML config file, else only boilerplate tests are run in a plugin
  Un-Rename PHPUnit XML config file as the odd extension is as per the docs
  Remove type declaration from get_api_data return value as it's sometimes a WP_Error, sometimes an array, never mixed..
  Rename PHPUnit XML config file
  Update wp-cli from ~0.22 to 2.3.0 (fixes #174)
@dotherightthing
Copy link
Owner Author

I may have been approaching this the wrong way.

Delicious Brains set up the page via WP CLI in the beforeEach lifecycle method in Cypress

https://deliciousbrains.com/cypress-testing/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant