SAP / spartacus

Spartacus is a lean, Angular-based JavaScript storefront for SAP Commerce Cloud that communicates exclusively through the Commerce REST API.
Apache License 2.0
740 stars 385 forks source link

E2E Tests Require Cypress 3.4.1. Version. Guest/Express Checkout Failure #5771

Closed giancorderoortiz closed 4 years ago

giancorderoortiz commented 4 years ago

Dev has recommended that e2e cypress tests run with version 3.4.1. Cookie errors seen in guest checkout and express checkout tests among others.

Screen Shot 2019-12-12 at 6 00 44 AM

package.json in projects/storefrontapp-e2e-cypress should have version = 3.4.1. for now until further investigation is done.

giancorderoortiz commented 4 years ago

See #5737 and #5736

Platonn commented 4 years ago

Cookies are validated against standard RFC 6265 since cypress PR is merged https://github.com/cypress-io/cypress/pull/5297 Our cookie values contain serialized JSON with quotes, i.e. {"checkout":{"express":true}}, which is now forbidden.

See https://stackoverflow.com/questions/1969232/what-are-allowed-characters-in-cookies

In 6265 the cookie name is still specified as an RFC 2616 token, which means you can pick from the alphanums plus:

!#$%&'*+-.^_`|~ In the cookie value it formally bans the (filtered by browsers) control characters and (inconsistently-implemented) non-ASCII characters. It retains cookie_spec's prohibition on space, comma and semicolon, plus for compatibility with any poor idiots who actually implemented the earlier RFCs it also banned backslash and quotes, other than quotes wrapping the whole value (but in that case the quotes are still considered part of the value, not an encoding scheme). So that leaves you with the alphanums plus:

!#$%&'()*+-./:<=>?@[]^_`{|}~

marlass commented 4 years ago

Fixed long time ago.

Platonn commented 4 years ago

Duplicate of https://github.com/SAP/spartacus/issues/5736