Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(webdriverjs): prevent selnium undefined -> null transformation #402

Merged
merged 7 commits into from
Nov 29, 2021

Conversation

AdnoC
Copy link
Contributor

@AdnoC AdnoC commented Nov 19, 2021

No description provided.

@CLAassistant
Copy link

CLAassistant commented Nov 19, 2021

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@WilcoFiers WilcoFiers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests

@@ -49,7 +49,7 @@ export function axeRunPartial(
var callback = arguments[arguments.length - 1];
var context = ${JSON.stringify(context)} || document;
var options = ${JSON.stringify(options)} || {};
window.axe.runPartial(context, options).then(callback);
window.axe.runPartial(context, options).then(res => JSON.parse(JSON.stringify(res))).then(callback);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this solve the issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is that there are places where a key is set to undefined rather than deleting it. Selenium finds these and converts them to null. JSON roundtrip removed the keys

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just return the string, so you don't have to serialise twice

Copy link
Contributor

@WilcoFiers WilcoFiers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a test

@@ -49,7 +49,7 @@ export function axeRunPartial(
var callback = arguments[arguments.length - 1];
var context = ${JSON.stringify(context)} || document;
var options = ${JSON.stringify(options)} || {};
window.axe.runPartial(context, options).then(callback);
window.axe.runPartial(context, options).then(res => JSON.parse(JSON.stringify(res))).then(callback);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just return the string, so you don't have to serialise twice

@AdnoC AdnoC dismissed WilcoFiers’s stale review November 29, 2021 16:10

Got rid of extra serialization. Added a test.

Copy link
Contributor

@Zidious Zidious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AdnoC AdnoC merged commit be3912d into develop Nov 29, 2021
@AdnoC AdnoC deleted the fix-selenium-undefined branch November 29, 2021 17:07
@michael-siek michael-siek mentioned this pull request Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants