question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Salesforce custom lightning components not visible to testcafe

See original GitHub issue

What is your Test Scenario?

Login to Salesforce and interact with any custom lightning component.

What is the Current behavior?

No custom lightning components appear to be visible to testcafe

What is the Expected behavior?

testcafe should be able to interact with custom lightning components just like a user in browser

What is your web application and your TestCafe test code?

Salesforce

Your website URL (or attach your complete example): custom_lightning_component_in_testcafe custom_lightning_component_in_browser

Your complete test code (or attach your test files):
import { Selector } from 'testcafe'; 

fixture`Custom Lightning Component issue`// declare the fixture
    .page`https://brave-bear-e42cd9-dev-ed.my.salesforce.com/`;  // specify the start page

test('Lightning Component', async t => {
    await t
        .typeText('#username','watkinssf@brave-bear-e42cd9.com')
       .typeText('#password','Password1234')
        .click('#Login')
        .click('.slds-icon-waffle')
        .click(Selector('ul li a span .label.slds-truncate.slds-text-link').withText('Accounts'))
        .click(Selector('.slds-truncate.outputLookupLink.slds-truncate.forceOutputLookup').withText('United Oil & Gas Corp.'))
        .expect(Selector('div.slds-card__body div').innerText).contains('Hello I\'m a custom lightning component')
}); 

</details>

<details>
<summary>

✖ Lightning Component

   1) Cannot obtain information about the node because the specified selector does not match any node in the DOM tree.

       > | Selector('div.slds-card__body div')

      Browser: Chrome 73.0.3683 / Mac OS X 10.14.4

          9 |        .typeText('#password','Password1234')
         10 |        .click('#Login')
         11 |        .click('.slds-icon-waffle')
         12 |        .click(Selector('ul li a span .label.slds-truncate.slds-text-link').withText('Accounts'))
         13 |        .click(Selector('.slds-truncate.outputLookupLink.slds-truncate.forceOutputLookup').withText('United Oil & Gas Corp.'))
       > 14 |        .expect(Selector('div.slds-card__body div').innerText).contains('Hello I\'m a custom lightning component')
         15 |        .debug()
         16 |});

         at Object.<anonymous> (/Users/brian.okeefe/Projects/DevExpress-TestCafe/e2e/tests/lightning_comp_test.ts:14:64)
         at <anonymous> (/Users/brian.okeefe/Projects/DevExpress-TestCafe/e2e/tests/lightning_comp_test.ts:7:71)
         at __awaiter (/Users/brian.okeefe/Projects/DevExpress-TestCafe/e2e/tests/lightning_comp_test.ts:3:12)
         at test (/Users/brian.okeefe/Projects/DevExpress-TestCafe/e2e/tests/lightning_comp_test.ts:6:39)
         at markeredfn (/usr/local/lib/node_modules/testcafe/src/api/wrap-test-function.js:17:28)
         at <anonymous> (/usr/local/lib/node_modules/testcafe/src/api/wrap-test-function.js:7:5)
         at fn (/usr/local/lib/node_modules/testcafe/src/test-run/index.js:242:19)
         at TestRun._executeTestFn (/usr/local/lib/node_modules/testcafe/src/test-run/index.js:238:38)
         at _executeTestFn (/usr/local/lib/node_modules/testcafe/src/test-run/index.js:291:24)



 1/1 failed (30s)
Screenshots:
attached

Steps to Reproduce:

  1. Go to the salesforce scratch org https://brave-bear-e42cd9-dev-ed.my.salesforce.com
  2. log in with credentials in test
  3. Navigate to Accounts
  4. Assert on custom lightning component with text “Hello I’m a custom lightning component”

Your Environment details:

  • testcafe version: 1.1.3
  • node.js version: v11.14.0
  • command-line arguments: testcafe chrome e2e/tests/lightning_comp_test.ts
  • browser name and version: Chrome 73.0.3683
  • platform and version: Mac OS X 10.14.4
  • other: have tried across multiple browsers and multiple versions of testcafe. bumping up to hammerhead v 14.6.0 resolved another issue for us where the navigation bar was not appearing in testcafe. Noticed the issue in our production like QA environment.
    Custom Lightning Component for this example was created through this trailhead https://trailhead.salesforce.com/en/content/learn/projects/quickstart-lightning-components/quickstart-lightning-components3

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Farfurixcommented, Apr 22, 2019

@blokeefe

Thank you.

I’ve reproduced the issue under Window 10 / Chrome 73 / testcafe-hammerhead@14.6.2 (DevExpress/testcafe-hammerhead@05d2788). We need some time to investigate this issue using your credentials.

0reactions
lock[bot]commented, May 4, 2019

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

custom lightning component is not visible in salesforce ...
I created custom lightning web component and want to show this in my salesforce community. i added lightning Community__Page in targets but ...
Read more >
Custom Lightning Component does not appear in Community ...
The Custom Component will not be visible on the Community unless you add the below tag to the component. <aura:component ...
Read more >
TestCafe v1.7.0 Released | Framework | Release Notes
TestCafe now allows you to obtain information about the current user agent. These data identify the operating system, platform type, browser, engine, etc....
Read more >
An in-range update of testcafe is breaking the build #94 - GitHub
The devDependency testcafe was updated from 1.3.3 to 1.4.0. View failing branch. This version is covered by your current version range and after...
Read more >
Newest 'testcafe' Questions - Stack Overflow
I am trying to open the Salesforce home page through UI automation (Testcafe), the Salesforce loading symbol is present for long time. It...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found