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

Cannot select dropdown option set by an object #149

Closed
plocket opened this issue Feb 6, 2021 · 0 comments · Fixed by #151
Closed

Cannot select dropdown option set by an object #149

plocket opened this issue Feb 6, 2021 · 0 comments · Fixed by #151
Labels
bug Something isn't working

Comments

@plocket
Copy link
Collaborator

plocket commented Feb 6, 2021

Those option nodes' values turn out to be base64 versions of the instance names of the values. Here's a failing test in 209APlaintiffMotionToModify.

The idea that I need to install code to try (which is hurting my brain right now):

// In scope.setField
    SELECT: async function ( scope, { handle, set_to }) {
      // This element's option value can be one of two things
      let to_select = await scope.page.evaluate((raw_value) => {
        let elem = document.querySelector(`option[value="${ raw_value }"]`);
        if ( !elem ) {
          let base64_name = await scope.base64( scope, raw_value );
          elem = document.querySelector(`option[value="${ base64_name }"]`);
        }
        
        if ( !elem ) { return `Did not find an option with the value "${ raw_value }"`; }
        else { return elem.value; }
      }, set_to );

      await handle.select( to_select );
      await scope.afterStep(scope, { waitForShowIf: true });
    },
@plocket plocket added the bug Something isn't working label Feb 6, 2021
plocket added a commit that referenced this issue Feb 7, 2021
Fix #149, dropdown options created from objects are not selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant