My alerts and dialog buttons are white in color after i have upgraded my NativeScript version to the latest one.
Please help me retrieve its original black color...
var dialogs = require("ui/dialogs");
dialogs.alert({
title: "Be Aware",
message: "Make sure you receive money from the customer before you REDEEM.",
okButtonText: "Customer Paid"
}).then(function () {
console.log("Dialog closed!");
});
Customer Paid button is white
The solution was found in the comments.
The problem was linked to a CSS property generated for an other button.
This property was also affecting the button in the modal.
Solution
Use another class/id/selector for the modal's button
OR
Use the same selector than the other button and change the values inside the CSS
Related
I am working on a UI automation project. I have to fill details in a form and click on 'Save' button. Once save button is clicked in manual flow, it turns grey and disabled. And after that a pop-up emerges to confirmation.
But when I run automation script to hit 'Save' button, script hits the button but it doesn't turn grey and still enabled. And I don't see any confirmation pop-up.
I tried lots of solutions for clicking 'Save' button, some of them are listed below but nothing works
cy.contains('Save').click()
cy.contains('Save').click({force:true})
cy.contains('Save').focus().type("{enter}")
cy.get('button span.MuiButton-label').contains('Save').click({force:true})
cy.get('span.MuiButton-label').contains('Save'). then($btn => {
cy.wrap($btn).scrollIntoView().click({force:true});
})
I am also attaching html for 'Save' button
I would be really thankful, if you please help me in finding solution for it.
What I can see from the image is the button contains some span and other empty elements if you can give the button an id this way you job would be much simpler
cy.get('#form-btn').click()
if not then treaverse from the main-content to the form then to the button
cy.get('#main-content').get('form').get('button').click()
Add data-cy="save" to your button and
Do this:
cy.get("[data-cy=save").click()
You can directly use the button text and click on it.
cy.contains('Save').should('be.visible').click({force: true})
If you have shadow DOM in the HTML, turn on includeShadowDom either in global config or in the test config.
Target the button in the cy.contains(). cy.contains('Save') will target the label, but that may not be clickable:
it('fills form', {includeShadowDom: true}, () => {
// fill form fields
cy.contains('button', 'Save').should('be.enabled').click()
})
All of the above answers were correct.
Additionally, you also want to check the colour change after clicking on the Save button. So you should have to check the CSS file and check the colour. I'm assuming here the button has some property color and you have to just use that HEX code for the colour. I used Charcoal colour as I don't know which grey shade your app used.
cy.contains('Save')
.should('be.visible')
.click({ force: true })
.should('have.css', 'color', 'rgb(54, 69, 79)')
Hello Im new web developer. i get empty button error from wave.webaim.org - WCAG 2.0 Level AA Accessibility.
Thats the code.
<button type="button" role="presentation" class="owl-prev disabled h-hidden" title="none">
any help on that?
Thanks in advance.
"An Empty Button error means that one of the buttons present on the web page is empty or contains no text describing the function of the button. Or, if it’s an image button, the image contained in the button is missing alternative text."
Source: https://equalizedigital.com/accessibility-checker/empty-button/
It could be that there's no text on the button. If you don't want to put a visible text on the button, you could put a visually hidden text that is read by screen readers, sometimes called the sr-only class in css.
More info: How to hide a text and make it accessible by screen reader?
You need to have actual text inside the button. If you don't want to have a visible text because you style the button in a certain way, using PisteVW solution from above works just fine.
Alternatively, you can use the attribute aria-label="button text here" to give the button a label.
Also, you need to remove role=presentation as the button performs a clear action, it's not there to simply indicate presentational images, for example: https://www.w3.org/TR/wai-aria-1.1/#presentation
http://skifimba.hostfree.pw/
This is my website. I'm noob in php/js and I want the following thing:
On the page I have added Request button (woocommerce) for products and when it's clicked a Contact form pops up. I want to echo the product name in <p></p> tags in the contact form. Anyone have an idea how this can be done?
Button locations
First button
Second button
All you have to do is add a click handler on the request button, find the text of the 'h3', and set the modal form's "name" field value to that.
Take this JavaScript for example
jQuery(document).ready(function($){
// When the Request button is clicked
$('.request-form-btn').on('click', function(){
// Set 'title' to the closest product's h3 text
var title = $(this).closest('.prod-i').find('h3').text();
// Set the value of the "name" field to the title we got above.
$('[name="modal_name"]').val( title );
});
});
It appears you're using a premium theme, so add this to the "Custom/Body/Footer" scripts section of the website if there is one, otherwise you'll need to use one of the many "Header/Footer" script plugins that are available.
You can test this by pasting the JavaScript into the dev tools console on that page.
I'm looking for help for sharing an open graph story ("video.rates" action on "video.movie" object), through the action share_open_graph.
It works, but I would like to customize it.
I attach 3 images to post:
album with three images
In the first image the user assigns a vote and writes a brief review ("Beautiful movie") to the movie; in the second image the user has the ability to insert an additional comment ("this text will be hidden"); in the third image the user published the open graph story correctly (review, vote and url are ok), but the last comment has disappeared and you see a "Salva" button.
I have two questions:
I don't understand why Facebook Dialog ask the last comment (when the user writes "this text will be hidden") if it does not show it. Can I remove the inclusion of the latter comment, in Facebook Share dialog?
Can I customize or remove the "Salva" button on the open graph story?
This is my Javascript code:
FB.ui({
method: 'share_open_graph',
action_type: 'video.rates',
action_properties: {
"rating:value": vote,
"rating:scale": 10,
"review_text": comment,
"movie": url
}
}, function (response) {
callback(response);
});
Aurelio, about your second question, "Can I customize or remove the "Salva" button on the open graph story?". The "Salva" button appears on the open graph story because your object inherits from business, it must inherit from object. When you do this, the salva button should automatically disappear.
I haven't found anything in Facebook's documentation that hints towards a way to hide the text input field in the dialog.
The fact that any text that is entered there will not be shown if your OG action has a free form text property already (like the review_text property on video.likes) seems to be a bug.
I recommend that you create a bug report with Facebook at https://developers.facebook.com/bugs/
I am trying to rerun a block of javascript when the user clicks on a button. The site was created in a CMS so I do not have access to the button to give it an id. However, in firebug I noticed it has these values ->
<input type="submit" value="Continue">
Is there anyway I can call to this by using the value of 'Continue'?
FYI: the button is coded with php and I want to rerun the following
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script type="text/javascript">
$(window).load(function resizePole(){
var ht=($('#LayoutColumn2').height() > $('#LayoutColumn3').height()) ?
$('#LayoutColumn2').height() : $('#LayoutColumn3').height(); $('#lightPole').height(ht); }); </script>
and I am attempting to call this using:
onclick="return resizePole();"
Oh and I know next to nothing about javascript :)
Link to page working on - you may have to create a customer account. Enter some jibberish and I can delete it later
link to site
What the problem is: Ok let me explain what should be happening. I have created a div called 'lightpole' this div contains a background image of a lightpole that is coded with javascript to match the height of the 'content' div when the page loads. On the checkout_express page the creators of the CMS system have created expanding and collapsible divs that guide the user through the checkout process. On the third step 'Shipping Method' the user clicks on the 'Continue' button which expands the 'Order Confirmation Step'. This div causes the 'content' div to be longer than on initial loading but the lightpole was only sized to match the inital height of the content, not the added height of the Order Confirmation Step so it causes the lightpole to be shorter than it actually needs to be.
This will work.
$('[type="submit"][value="Continue"]').click(function () {
{
return resizePole();
});
EDIT
As pointed out in the comments, there is a more concise way to do this. I typically use the method above out of habit (makes it easier to add future logic to the click event).
$('[type="submit"][value="Continue"]').click(resizePole);
EDIT 2
To answer the question in the comments - yes, you can filter by the div ID as well. This will attach to the click event of all submit buttons inside a div with an id of DivIdHere and a value of Continue.
$('#DivIdHere [type="submit"][value="Continue"]').click(resizePole);
EDIT 3
This is a bit dirty, but after looking at your updated requirments, this should do the trick. Basically, it adds the click event to the last submit button on the page that has a value of continue (which appears to be the shipping section based on the link you provided).
$('[type="submit"][value="Continue"]:last').click(resizePole);