I would like to make a rating star so I have the code below:
<g:each in="${1..5}" var="rateCount">
<g:if test="rateCount < myResultList.rating">
<i class="fa fa-star"></i>
</g:if>
</g:each>
I have a rating with 4 and suppose to display 4 stars only.
However there is displaying 5 stars. So I replace the star with ${rateCount < myResultList.rating} between the if statement and I got below items on my page:
true true true true false
What did I do wrong?
I found that the problems is I was missing a ${ tag, the program is working after I changed the if statement as below:
<g:if test="${rateCount < myResultList.rating}">
Related
I used get text/get value with the xpath element, but it's not getting the text/value.
Below are the Code and tried to get text/value and getting element not visible error.
Note : Same element is working For click element.
<div class="cal-month-day cal-day-inmonth cal-day-future cal-day-has-events" ng-class="{
'cal-day-outmonth': !day.inMonth,
'cal-day-inmonth': day.inMonth,
'cal-day-weekend': day.isWeekend,
'cal-day-past': day.isPast,
'cal-day-future': day.isFuture,
'cal-day-has-events': day.events.length > 0,
'cal-day-selected': vm.calendarCtrl.isSelectedDate(day),
'cal-day-open': dayIndex === vm.openDayIndex
}" ng-click="vm.calendarCtrl.onDateSelection(day.date)">
<small class="cal-events-num badge badge-important pull-left ng-binding" ng-show="day.badgeTotal > 0 && (vm.calendarConfig.displayAllMonthEvents || day.inMonth)" ng-bind="day.badgeTotal">2</small>
<span class="pull-right ng-binding" ng-bind="day.label">2</span>
I have a series of a tags that represent steps. As shown here, if step one is the current step, apply the step-active class.
<a (click)="goStep2" [ngClass]="{'step-active': currentStep === 1 }">
Step 1
</a>
Now, I'd like also to add another condition which related to the contain of the page. Let's user has responded to all the required questions. I'd like to highlight the step by green if the step is valid, otherwise by red.
<a (click)="goStep2" [ngClass]="{'step-active': currentStep === 1,
isValid ? 'valid-state' : 'invalid-state' }">
Step 1
</a>
I'm getting an error about missing :. How to apply this 2 conditions given that the first one is just a simple condition while the second is a ternary one.
Thanks for helping
<a (click)="goStep2" [ngClass]="{'step-active': currentStep === 1,
'valid-state' : isValid, 'invalid-state': !isValid }">
Step 1
</a>
Just running through the Meteor tutorial. I'm currently at the update / remove section https://www.meteor.com/tutorials/blaze/update-and-remove
The code shows
<template name="task">
<li class="{{#if checked}}checked{{/if}}">
<button class="delete">×</button>
<input type="checkbox" checked="{{checked}}" class="toggle-checked" />
<span class="text">{{text}}</span>
</li>
</template>
I'm about confused about where 'checked' needs to be the same. Is it only in the curly braces?
The curly braces invoke the data binding to the template data or helpers
the {{checked}} in curly braces will be substituted with the current data value (int this case the true or false depending on the state of the item in your database).
As checked is a boolean value, this will render as true or false depending on what is stored in your item.
I am trying to click a button using Selenium.
Below is the code
<div class="ui-dialog-buttonset">
<button class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" type="button" role="button" aria-disabled="false">
<span class="ui-button-text"> … </span>
</button>
I tried to do this by the css selector:
clickbutton=driver.find_element_by_css_selector("button.ui-button.ui-widget.ui-state-default.ui-corner-all.ui-button-text-only")
**My error: Unable to locate element: { method: "css selector","selector":"button.ui-button.ui-widget.ui-state-default.ui-corner-all.ui-button-text-only"} **
Am I approaching this wrong? Im not understanding the error. Shoud I use another Locator?
Your css selector is ok the problem is related to html code which setting aria-disabled="false" for compability. For Web3 documentation it means that related element and descandent are active but in your case it is not working.
Simple you can set the aria-disabled="true" then you can interact with the button but even you set it back to false it still works. To change the button attribute, you can use execute_script. Alternative to your css you use this css too: .ui-dialog-buttonset > button
>>> dr.find_element_by_css_selector(".ui-dialog-buttonset > button").get_attribute("aria-disabled")
u'false'
>>> dr.execute_script('document.querySelector(".ui-dialog-buttonset > button").setAttribute("aria-disabled", true)')
>>> dr.find_element_by_css_selector(".ui-dialog-buttonset > button").get_attribute("aria-disabled")
u'true'
>>> dr.find_element_by_css_selector(".ui-dialog-buttonset > button").click()
I have a submit button with text and I want to check for both.
i.e. the actual page has:
<input class="button" type="submit" value="Continue" tabindex="3"
name="nav[save]"></input>`
So I've tried
it "I can see the Continue button" do
expect(page.find('input[type="submit"]').find('input[value="Continue"]')).to be
end
but I get
Unable to find css "input[value=\"Continue\"]"
and
expect(page.find('input[type="submit"]')).
to have_selector('input[value="Continue"]')
but I get
expected to find css "input[value=\"Continue\"]" but there were no matches
If you want to check for both you can do it in single css selector like
input[type=\"submit\"][value=\"Continue\"]
Here's one solution that works with your view:
expect(find('.button').value).to eq 'Continue'
In the console:
[1] pry(#<Cucumber::Rails::World>)> expect(find('.button').value).to eq 'Continue'
=> true