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

Added a new feature to toggle between technical names and display names in the XDM Object #446

Merged
merged 5 commits into from
Jan 10, 2025

Conversation

shammowla
Copy link
Contributor

Description

Related Issue

Motivation and Context

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (non-breaking change which does not add functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA or I'm an Adobe employee.
  • I have made any necessary test changes and all tests pass.
  • I have run the Sandbox successfully.
  • I've updated the schema in extension.json or no changes are necessary.
  • My change requires a change to the documentation.

@carterworks
Copy link
Contributor

carterworks commented Nov 22, 2024

There are 7 failing tests, all around update variable. On other PRs, 5 are failing, meaning 2 are unique to your changes. Here are the tests that are newly failing.

  • × Update variable action view - keeps data around when changing data elements and schema objects
          1) The specified selector does not match any element in the DOM tree.
    
      > | Selector('[data-test-id='xdmTree']')
      | .find('[data-test-id='xdmTreeNodeTitleDisplayName']')
      | .withText('otherField')
      | .parent('[data-test-id='xdmTreeNodeTitle']')
      | .nth(0)
    
      Browser: Chrome 129.0.0.0 / Windows 11
    
      50 | .parent(".ant-tree-treenode")
      51 | .nth(0)
      52 | .find(".ant-tree-switcher");
      53 | return {
      54 | click: async () => {
      > 55 | await t.click(node);
      56 | },
      57 | toggleExpansion: async () => {
      58 | await t.click(expansionToggle);
      59 | // wait for animation to finish
      60 | await t.wait(100);
    
      at Object.<anonymous>
      (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:55:17)
      at asyncGeneratorStep
      (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:1:68)
      at _next
      (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:1:317)
      at <anonymous>
      (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:1:448)
      at Object.<anonymous>
      (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:1:247)
      at Object.click [as click]
      (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:56:47)
      at <anonymous>
      (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/specs/view/actions/updateVariable.spec.mjs:235:40)
      at asyncGeneratorStep
      (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/specs/view/actions/updateVariable.spec.mjs:1:68)
      at _next
      (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/specs/view/actions/updateVariable.spec.mjs:1:317)
      </pre>
    </details>
    
  • × Update variable action view - keeps data around when changing data elements and schema arrays
          1) The specified selector does not match any element in the DOM tree.
    
      > | Selector('[data-test-id='xdmTree']')
      | .find('[data-test-id='xdmTreeNodeTitleDisplayName']')
      | .withText('Item 1')
      | .parent('[data-test-id='xdmTreeNodeTitle']')
      | .nth(0)
      | .parent('.ant-tree-treenode')
      | .nth(0)
      | .find('.ant-tree-switcher')
    
      Browser: Chrome 129.0.0.0 / Windows 11
    
      53 | return {
      54 | click: async () => {
      55 | await t.click(node);
      56 | },
      57 | toggleExpansion: async () => {
      > 58 | await t.click(expansionToggle);
      59 | // wait for animation to finish
      60 | await t.wait(100);
      61 | },
      62 | expectInViewport: async () => {
      63 | const isElementInViewport = await getIsElementInViewport(node);
    
      at Object.&lt;anonymous&gt;
      (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:58:17)
      at asyncGeneratorStep
      (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:1:68)
      at _next
      (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:1:317)
      at &lt;anonymous&gt;
      (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:1:448)
      at Object.&lt;anonymous&gt;
      (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:1:247)
      at Object.toggleExpansion [as toggleExpansion]
      (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:61:58)
      at &lt;anonymous&gt;
      (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/specs/view/actions/updateVariable.spec.mjs:268:36)
      at asyncGeneratorStep
      (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/specs/view/actions/updateVariable.spec.mjs:1:68)
      at _next
      (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/specs/view/actions/updateVariable.spec.mjs:1:317)
      </pre>
    </details>
    

Copy link
Contributor

@jonsnyder jonsnyder left a comment

Choose a reason for hiding this comment

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

The code looks good. Let's do another demo in standup.

test/functional/helpers/objectEditor/xdmTree.mjs Outdated Show resolved Hide resolved
Copy link
Contributor

@carterworks carterworks left a comment

Choose a reason for hiding this comment

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

Resolve the two new failing tests and we are golden.

  • × XDM Object Display Names - toggles between display names and field IDs
    1) AssertionError: expected undefined to be truthy
      Browser: Chrome 129.0.0.0 / Windows 11
          30 |  await schemaField.selectMenuOption("XDM Object Data Element Tests");
          31 |  await xdmTree.node("_unifiedjsqeonly").toggleExpansion();
          32 |  await xdmTree.node("vendor").toggleExpansion();
          33 |
          34 |  // Initially should show field IDs (default)
        > 35 |  await t.expect(xdmTree.node("name").exists).ok();
          36 |
          37 |  // Toggle to show display names
          38 |  await xdmTree.enableDisplayNames();
          39 |  await t.expect(xdmTree.node("Name").exists).ok();
          40 |
          at  (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/specs/view/dataElements/xdmObjectDisplayNames.spec.mjs:35:47)
          at asyncGeneratorStep (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/specs/view/dataElements/xdmObjectDisplayNames.spec.mjs:1:68)
          at _next (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/specs/view/dataElements/xdmObjectDisplayNames.spec.mjs:1:317)
    
  • × XDM Object Editing - allows user to provide individual array items
    1) The specified selector does not match any element in the DOM tree.
        > | Selector('[data-test-id='xdmTree']')
          |   .find('[data-test-id='xdmTreeNodeTitleDisplayName']')
          |   .withText(/^implementationDetails$|^implementationdetails$/i)
          |   .parent('[data-test-id='xdmTreeNodeTitle']')
          |   .nth(0)
          |   .parent('.ant-tree-treenode')
          |   .nth(0)
          |   .find('.ant-tree-switcher')
      Browser: Chrome 129.0.0.0 / Windows 11
          54 |  return {
          55 |    click: async () => {
          56 |      await t.click(node);
          57 |    },
          58 |    toggleExpansion: async () => {
        > 59 |      await t.click(expansionToggle);
          60 |      // wait for animation to finish
          61 |      await t.wait(100);
          62 |    },
          63 |    expectInViewport: async () => {
          64 |      const isElementInViewport = await getIsElementInViewport(node);
          at Object. (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:59:17)
          at asyncGeneratorStep (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:1:68)
          at _next (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:1:317)
          at  (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:1:448)
          at Object. (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:1:247)
          at Object.toggleExpansion [as toggleExpansion] (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:62:58)
          at  (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/specs/view/dataElements/xdmObjectEditing.spec.mjs:37:49)
          at asyncGeneratorStep (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/specs/view/dataElements/xdmObjectEditing.spec.mjs:1:68)
          at _next (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/specs/view/dataElements/xdmObjectEditing.spec.mjs:1:317)
    

@shammowla
Copy link
Contributor Author

There are 7 failing tests, all around update variable. On other PRs, 5 are failing, meaning 2 are unique to your changes. Here are the tests that are newly failing.

* × Update variable action view - keeps data around when changing data elements and schema objects
        
              1) The specified selector does not match any element in the DOM tree.
  ```
    > | Selector('[data-test-id='xdmTree']')
    | .find('[data-test-id='xdmTreeNodeTitleDisplayName']')
    | .withText('otherField')
    | .parent('[data-test-id='xdmTreeNodeTitle']')
    | .nth(0)
  
    Browser: Chrome 129.0.0.0 / Windows 11
  
    50 | .parent(".ant-tree-treenode")
    51 | .nth(0)
    52 | .find(".ant-tree-switcher");
    53 | return {
    54 | click: async () => {
    > 55 | await t.click(node);
    56 | },
    57 | toggleExpansion: async () => {
    58 | await t.click(expansionToggle);
    59 | // wait for animation to finish
    60 | await t.wait(100);
  
    at Object.&lt;anonymous&gt;
    (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:55:17)
    at asyncGeneratorStep
    (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:1:68)
    at _next
    (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:1:317)
    at &lt;anonymous&gt;
    (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:1:448)
    at Object.&lt;anonymous&gt;
    (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:1:247)
    at Object.click [as click]
    (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:56:47)
    at &lt;anonymous&gt;
    (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/specs/view/actions/updateVariable.spec.mjs:235:40)
    at asyncGeneratorStep
    (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/specs/view/actions/updateVariable.spec.mjs:1:68)
    at _next
    (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/specs/view/actions/updateVariable.spec.mjs:1:317)
    </pre>
  </details>
  ```

* × Update variable action view - keeps data around when changing data elements and schema arrays
              1) The specified selector does not match any element in the DOM tree.
  ```
    > | Selector('[data-test-id='xdmTree']')
    | .find('[data-test-id='xdmTreeNodeTitleDisplayName']')
    | .withText('Item 1')
    | .parent('[data-test-id='xdmTreeNodeTitle']')
    | .nth(0)
    | .parent('.ant-tree-treenode')
    | .nth(0)
    | .find('.ant-tree-switcher')
  
    Browser: Chrome 129.0.0.0 / Windows 11
  
    53 | return {
    54 | click: async () => {
    55 | await t.click(node);
    56 | },
    57 | toggleExpansion: async () => {
    > 58 | await t.click(expansionToggle);
    59 | // wait for animation to finish
    60 | await t.wait(100);
    61 | },
    62 | expectInViewport: async () => {
    63 | const isElementInViewport = await getIsElementInViewport(node);
  
    at Object.&lt;anonymous&gt;
    (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:58:17)
    at asyncGeneratorStep
    (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:1:68)
    at _next
    (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:1:317)
    at &lt;anonymous&gt;
    (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:1:448)
    at Object.&lt;anonymous&gt;
    (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:1:247)
    at Object.toggleExpansion [as toggleExpansion]
    (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/helpers/objectEditor/xdmTree.mjs:61:58)
    at &lt;anonymous&gt;
    (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/specs/view/actions/updateVariable.spec.mjs:268:36)
    at asyncGeneratorStep
    (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/specs/view/actions/updateVariable.spec.mjs:1:68)
    at _next
    (file:///D:/sauce-testcafe-runner/3.10.0/bundle/__project__/test/functional/specs/view/actions/updateVariable.spec.mjs:1:317)
    </pre>
  </details>
  ```

Fixed the failing test issue. Can you please try running it again and see if you're seeing any failures.

@shammowla shammowla merged commit 96ff4ae into main Jan 10, 2025
4 checks passed
@shammowla shammowla deleted the PDCL-12749 branch January 10, 2025 17:08
dompuiu pushed a commit that referenced this pull request Jan 17, 2025
…es in the XDM Object (#446)

* Toggle between technical names and display names in the XDM Object.

* Rename display name toggle helper and update test.
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.

3 participants