TestStack / TestStack.Seleno

Seleno helps you write automated UI tests in the right way by implementing Page Objects and Page Components and by reading from and writing to web pages using strongly typed view models.
http://teststack.github.com/TestStack.Seleno/
MIT License
180 stars 60 forks source link

Filtering properties on the viewmodel for Input.Model #180

Open mattcowen opened 9 years ago

mattcowen commented 9 years ago

Hi

I hope that raising this via an issue is ok. My apologies if not.

What is the best practice for ignoring view model properties if I can't use a HiddenInput, ReadOnly or ScaffoldColumn attributes? The app I am working on has many views sharing view models so I wondered if there were any recommended alternatives to using the current input.model call of PageWriter?

Thanks Matt

mwhelan commented 9 years ago

Hi Matt, I think your only alternative is to use the individual methods on PageWriter to add each visible property.

Perhaps it would be useful to have an overload of Model() where you could pass a string array of control names to ignore?

robdmoore commented 9 years ago

If we did that it could be a params of strongly typed lambda expressions rather than strings, so it's type safe.

+1 for that though, I've wanted that in the past.

Michael Whelan notifications@github.com wrote:

Hi Matt, I think your only alternative is to use the individual methods on PageWriter methods to add each visible property.

Perhaps it would be useful to have an overload of Model() where you could pass a string array of control names to ignore?

— Reply to this email directly or view it on GitHub.

mattcowen commented 9 years ago

Just so you guys know, I have implemented an overload for input.model that takes a params of lambda expressions as described. I will submit a pull request as soon as I get a spare minute.

mwhelan commented 9 years ago

Great. Will be interested to see it.

mattcowen commented 9 years ago

I have submitted the pull request. Let me know if I've missed something. I would have thought one could link this issue to the commit somehow but couldn't see a way

robdmoore commented 9 years ago

You can reference this issue by putting #180 in your commit message or in a comment on the pull request. I don't see a pull request from you so you haven't submitted it correctly yet.

mattcowen commented 9 years ago

Yeah, I reverted thinking that I'd missed a problem in testing. Turns out that my upgrade of Firefox this morning now means I can't run any tests in Seleno. Anyone else on Firefox version 33 seeing this? Probably more of a selenium question.

I'm trying to commit the changes to a "pagewriter-property-blacklist" branch but getting errors

robdmoore commented 9 years ago

Yeah. When using Firefox with selenium I generally recommend turning off auto upgrading since it almost always breaks selenium.

Feel free to raise the Pr anyway and our ci server will build it.

On 22 Oct 2014, at 8:51 pm, mattcowen notifications@github.com wrote:

Yeah, I reverted thinking that I'd missed a problem in testing. Turns out that my upgrade of Firefox this morning now means I can't run any tests in Seleno. Anyone else on Firefox version 33 seeing this? Probably more of a selenium question.

I've committed the changes to the "pagewriter-property-blacklist" branch

— Reply to this email directly or view it on GitHub.

mattcowen commented 9 years ago

Ok, bit of a joke I know but it is there now. This constitutes my first pull request and I'd not gone about things in quite the right way. Please let me know if I need to do anything else.

Thanks

robdmoore commented 9 years ago

Not a joke at all mate. It looks good :)

mwhelan commented 9 years ago

Just noticed, think this is a duplicate of #121