Giter Club home page Giter Club logo

Comments (6)

cpathipati avatar cpathipati commented on June 2, 2024 2

Thanks, @olivier-martin-sf. This issue is resolved now!
I will continue testing and will let know if any issues.

Thanks again

from utam-js-recipes.

olivier-martin-sf avatar olivier-martin-sf commented on June 2, 2024

Thank you for taking the time to report this issue. Looking at the information you provided, I have a couple of questions:

  1. Did you replace the values in the .env file with the values for your environment?
  2. Were you able to build the page objects? (yarn build at the root of the workspace)
  3. What gives cat utam-preview/pageObjects/Login.js

Your issue happens in the beforeAll hook in the test when we try to login against the environment. We try to load the Login page object during that hook and it seems that's where the issue is coming from:

export async function login(testEnvironment, landingPagePartialUrl) {
    const { baseUrl, username, password } = testEnvironment;

    console.log(`Navigate to login URL: ${baseUrl}`);
    await browser.url(baseUrl);
    const login = await utam.load(Login); // it seems like the problem you are having happens here 
    await login.loginToHomePage(username, password, landingPagePartialUrl);
}

Hopefully that makes sense, looking forward to hear back from you

from utam-js-recipes.

cpathipati avatar cpathipati commented on June 2, 2024

Thanks, Martin

listing steps below and I am happy to join conf. call on zoom or webcall.

  1. I replaced .env file (with my login and credentials)
  2. renamed existing pageObject folder to pageObject2
  3. ran yarn build, this generated new pageObject folder (just to ensure I have the newly compiled files)
  4. Than ran only - yarn test --spec force-app/test/record-create.spec.js
  5. got an error with saying (Error: An element on the interface of UTAM Element or a Locator must be provided in order to load a PageObject)

I added try/catch and below is the modified code and error stack. and I also verified the code gets my credentials
added modified utilites/salesforce-test.js

try{
const login = await utam.load(Login);
console.log('after UTAM load');
await sleep(2000);

    await login.login(username, password);
  
    await sleep(2000);
}catch(e){
    console.log('after UTAM load error');
    console.log(e);
}

=== error stack

[0-0] Error: An element on the interface of UTAM Element or a Locator must be provided in order to load a PageObject
at UtamLoader.load (/Users/chandrasekar.pathipa/sf-unified/utam-js-recipes/node_modules/@utam/loader/build/index.js:42:19)
at login (/Users/chandrasekar.pathipa/sf-unified/utam-js-recipes/force-app/test/utilities/salesforce-test.js:23:34)
at UserContext. (/Users/chandrasekar.pathipa/sf-unified/utam-js-recipes/force-app/test/record-create.spec.js:67:9)
at UserContext.executeAsync (/Users/chandrasekar.pathipa/sf-unified/utam-js-recipes/node_modules/@wdio/utils/build/shim.js:101:16)
at UserContext.exports.testFrameworkFnWrapper (/Users/chandrasekar.pathipa/sf-unified/utam-js-recipes/node_modules/@wdio/utils/build/test-framework/testFnWrapper.js:25:18)
[0-0] 2022-02-07T19:14:40.981Z DEBUG @wdio/utils:shim: Finished to run "afterHook" hook in 0ms

from utam-js-recipes.

olivier-martin-sf avatar olivier-martin-sf commented on June 2, 2024

I just sent you an invite to join our external support channel (via email) where we'll be able to jump in a video call and troubleshoot this. This should speed up the process! Hope this works for you.

from utam-js-recipes.

olivier-martin-sf avatar olivier-martin-sf commented on June 2, 2024

After some analysis, the issue was caused by different versions of the UTAM dependencies being present in the workspace's packages:

After resetting versions of the dependencies to be in async (to 1.0.1) and running yarn clean && yarn build && yarn install we were able to have the test running.

@cpathipati feel free to close the issue to confirm the problem has been solved!

from utam-js-recipes.

irinash13 avatar irinash13 commented on June 2, 2024

Thanks a lot, Olivier, @olivier-martin-sf

from utam-js-recipes.

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.