Giter Site home page Giter Site logo

Comments (21)

esalman-sfdc avatar esalman-sfdc commented on July 17, 2024 1

We determined that that 'endsWith' of undefined error was actually being thrown by the error handling/logging logic in sfdx plugin and essetially ends up masking the actual error. We have logged a bug for that on the plugin team.
In the case of force:lightning:test:run most likely the underlying error is related to failure while opening a browser due to environmental issues.

from lightningtestingservice.

esalman-sfdc avatar esalman-sfdc commented on July 17, 2024

Hey @madmax983 could you please share details around what you did to move to GA release.

I am using "salesforcedx 41.4.1" (checked using sfdx plugins) and the command runs without any error for me.

from lightningtestingservice.

madmax983 avatar madmax983 commented on July 17, 2024

Hi @esalman-sfdc. I ran the gist here: https://gist.github.com/dcarroll/7d7a4b97a0d77f26c9f6fc6d73b689a6

And then redownloaded and installed the CLI from here: https://developer.salesforce.com/tools/sfdxcli

If I run just sfdx plugins I get "no plugins installed'.

sfdx plugins --core gets me "salesforcedx 41.4.1".

I am going to try to blow away the LTS components and reinstalling with sfdx force:lightning:test:install

from lightningtestingservice.

madmax983 avatar madmax983 commented on July 17, 2024

Update: Uninstalling and reinstalling didn't fix the issue with the original app.

However, I did clone this repo and setup a scratch org against it and the command ran fine. So I think it is fair to say its an environment issue with my original app's workspace. I'll close this out, because it is likely something leftover from the pilot or beta that throwing a wrench in the mix.

from lightningtestingservice.

esalman-sfdc avatar esalman-sfdc commented on July 17, 2024

Hey @madmax983 were you able to figure out the underlying cause. Asking because somebody else has reported a similar issue but there isn’t a repro.

from lightningtestingservice.

madmax983 avatar madmax983 commented on July 17, 2024

@esalman-sfdc I don't know that I figured out the underlying cause, but I did manage to resolve it.

https://github.com/madmax983/lightning-redux is the repo that was experiencing the issue, and you can see the chain of commits on Oct 19th. Matching the travis.yml in this repo is what looked to fix the issue.

I still get the error locally if I try to run it against a non-scratch org, but it works fine locally with scratch orgs. Not sure if that is a limitation on the plugin.

from lightningtestingservice.

esalman-sfdc avatar esalman-sfdc commented on July 17, 2024

Thanks @madmax983. I'll update this thread if we we are able to find the root cause.

By the way on a side note, I don't think you need 'heroku plugins:install salesforce-lightning-cli' anymore as sfdx cli comes packaged with the lint command now :)

from lightningtestingservice.

congadevleads avatar congadevleads commented on July 17, 2024

I'm struggling troubleshooting this error message in docker image atlassian/default-image, I've installed chromium-browser and tried to set all the ENV vars etc I could from the travis CI example files. Has anyone got this working in a docker image or only with Travis CI?

from lightningtestingservice.

esalman-sfdc avatar esalman-sfdc commented on July 17, 2024

I personally haven't tried using sfdx in a docker image/container. May be searching (on google) for how to run webdriver tests in docker container can provide possible suggestions.

Another user had asked about this here but I am not sure if he was able to find a solution or not.

Underneath the cover, the command uses webdriver.io, and desired capabilities (e.g. browser to use etc.) can be controlled. See my comment here

from lightningtestingservice.

congadevleads avatar congadevleads commented on July 17, 2024

I was able to resolve my issue by running these cli commands before running my tests,

export DISPLAY=:0
Xvfb :0 -ac -screen 0 1024x768x24 &

Then when running tests adding a -f config file which looks like this,

{
  "webdriverio": {
    "desiredCapabilities": {
      "browserName": "chrome",
      "chromeOptions": {
        "args": ["--no-sandbox"]
      }
    }
  }
}

This was while running in atlassian/default-image docker image after installing chrome browser.

from lightningtestingservice.

esalman-sfdc avatar esalman-sfdc commented on July 17, 2024

Glad to hear.
Thanks for posting your solution as it may help others.

from lightningtestingservice.

red-parrot avatar red-parrot commented on July 17, 2024

I am not able to run Lightning Test Service on Jenkins(on AWS server). Getting error "Cannot read property 'endsWith' of undefined". I have not tried using docker image/container. Is there any work around to overcome this issue?

from lightningtestingservice.

esalman-sfdc avatar esalman-sfdc commented on July 17, 2024

Kindly go over the details in this thread. Solution should be similar.

from lightningtestingservice.

frederikladewig avatar frederikladewig commented on July 17, 2024

Just an additional information to help to identify the correct error:
I changed ~/.local/share/sfdx/client/node_modules/salesforce-alm/dist/index.js:185 to:
message: err.message || err.name || err,

This helps to get the correct error message logged (which in my case was the following: "ERROR: Lightning Testing Service can only run in scratch orgs, because tests can permanently change org data.")

from lightningtestingservice.

congadevleads avatar congadevleads commented on July 17, 2024

I also made @frederikladewig error handling bug fix to troubleshoot chrome/webdriver issues, salesforce-alm project should fix this. I think chrome-stable introduced a new bug recently that broke my UI tests, to fix I had to commit the chrome user-data Default/Cache folder, for some reason the first time Chrome is launched webdriver has issues communicating with it if the Cache folder does no exist yet.

Had something to do with LogLevels and manifested similar to this Chrome bug,
https://bugs.chromium.org/p/chromedriver/issues/detail?id=1773

from lightningtestingservice.

donaldrivard avatar donaldrivard commented on July 17, 2024

I am getting the error unknown error: missing or invalid 'entry.level' even after all the changes including upgrading chromedriver. I only get the error when I run the tests using

sfdx force:lightning:test:run -a JasmineTesting.app

BUT if I add -o to that command or run

sfdx force:org:open -p /c/JasmineTesting.app

The tests work fine.

Any ideas?

ChromeDriver 2.34.522932

from lightningtestingservice.

congadevleads avatar congadevleads commented on July 17, 2024

Thanks @donaldrivard, I'm having the same problem. It appears something updated (I think it was chrome) and broke some functionality. "entry.level" appears to have something to do with Chrome logs, see my chromium bug link above. I hand't noticed that -o was a workaround and is better than the solution I was trying. I noticed it has something to do with Chrome user data, specifically Default/Cache folder. Running the command the first time without -o always failed until Chrome created it's user data folder, then consecutive runs would succeed without issue. However this is a problem in my CI as I have a clean Docker image on each run. Thanks for the tip!

from lightningtestingservice.

donaldrivard avatar donaldrivard commented on July 17, 2024

@congadevleads I tried the link above but no luck on my machine. I am also using Travis CI in my process and the sfdx force:lightning:test:run -a JasmineTesting.app command works fine in that environment. So it is definitely my machine but I cannot figure out what it is. The frustrating thing is that everything was fine until yesterday.

from lightningtestingservice.

congadevleads avatar congadevleads commented on July 17, 2024

@donaldrivard my issue is different than linked chromium issue as well, I think chrome reintroduced a similar issue by mistake in a recent release and thats why we both suddenly ran in to this issue this week. Hopefully someone is going to fix it...

from lightningtestingservice.

alexed1 avatar alexed1 commented on July 17, 2024

I get this error when I try to run sfdx force:lightning:test:run -a jasmineTests.app from my docker environment. I can run the tests in that app fine if I do it manually from the browser. I already fail on attempts to login to orgs from sfdx from inside my docker container, so this is probably that same problem.

Using the trick frederikladewig suggests, above, the error message that I get becomes "ERROR: An unknown server-side error occurred while processing the command. (UnknownError:13)." So it's the same problem as ws repored here.

from lightningtestingservice.

positonic avatar positonic commented on July 17, 2024

setting 'publicPath' fixed this for me

from lightningtestingservice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.