Giter Club home page Giter Club logo

Comments (16)

PatrickJS avatar PatrickJS commented on July 21, 2024

I'm working on this now

from universal.

PatrickJS avatar PatrickJS commented on July 21, 2024

I'm not sure how to get element props with protractor to test client rendered elements and selection

from universal.

manekinekko avatar manekinekko commented on July 21, 2024

Hi @gdi2290 have you started this?

from universal.

PatrickJS avatar PatrickJS commented on July 21, 2024

@manekinekko I push up the wip. the problem is getting the props rather than the attrs
https://github.com/angular/universal/blob/master/test/test_page.e2e.js
you would need to inject js to grab elements and expose them to protractor I think

from universal.

manekinekko avatar manekinekko commented on July 21, 2024

@gdi2290 which props do you wanna test? I managed to read pros from DOM element.

from universal.

PatrickJS avatar PatrickJS commented on July 21, 2024

@manekinekko the input to ensure selection is correct and the value of the input

from universal.

manekinekko avatar manekinekko commented on July 21, 2024

@gdi2290 using executeScript you can run arbitrary js code. So for example, this gives you the value property:

it('should have default value for inputs', function() {
  subject = browser.executeScript('return document.querySelector("#defaultValueInput").value');
  result  = 'value8';

  expect(subject).toBe(result);
});

from universal.

PatrickJS avatar PatrickJS commented on July 21, 2024

oh that's a good find and solves a lot of problems 👍

from universal.

manekinekko avatar manekinekko commented on July 21, 2024

should I emphasis on the difference between the prop "value" and the attribute "value" in the test suites?

from universal.

PatrickJS avatar PatrickJS commented on July 21, 2024

yup, although for server only it's attrs while everything else it's props it's important to note that

from universal.

manekinekko avatar manekinekko commented on July 21, 2024

@gdi2290 here is what I was able to test so far. As you can see from the screenshot below, there is one test that fails and 3 pending test that I don't know how to test (the preboot ones).
I let you check that if you dont mind ;)

If you're OK. I'll send the PR right away.

image

from universal.

PatrickJS avatar PatrickJS commented on July 21, 2024

LGTM

from universal.

PatrickJS avatar PatrickJS commented on July 21, 2024

selection isn't really working with preboot or at least not with the e2e tests

from universal.

PatrickJS avatar PatrickJS commented on July 21, 2024

@jeffwhelpley can you take a look at the e2e tests to see why it's failing
https://github.com/angular/universal/blob/master/test/test_page.e2e.js#L86...L103

from universal.

PatrickJS avatar PatrickJS commented on July 21, 2024

done via ae31bd2

from universal.

angular-automatic-lock-bot avatar angular-automatic-lock-bot commented on July 21, 2024

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

from universal.

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.