bigbite / wp-cypress

WordPress end to end testing with Cypress.io.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Potential browser cache issue

con322 opened this issue · comments

Through writing some tests for the NewsPress Multi-Title plugin I've came across two things that occur;

The first is sometimes when cypress loads the post, a WordPress notice will be displayed saying something like The backup of this post in your browser is different from the version below. - You can get around this for some things by passing force: true for example:

cy.get('button#0-seo').click({ force: true });

But that seems unnecessary.

The second is probably related to the first however there is no notice, but when loading the post data already exists within the Multi-title field(s), which since we drop the database completely, points the issue to WordPress caching the post somewhere.

Looks like WordPress must store the post in local storage as per this thread - https://wordpress.org/support/topic/the-backup-of-this-post-in-your-browser-is-different-from-the-version-below-8/

Cypress handles clearing browser cache in between integration tests and we decided that, for now, that it would be up to a developer to ensure their post is saved and up to date between single tests to avoid these messages.