This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Object.values().filter(Boolean) | |
// ------------------------------- | |
// Video: https://courses.wesbos.com/account/access/5f69bb13ebaa134ef228e80e/view/455624835 | |
// Filter undefinded toppings out | |
const tops = Object.values(toppings).filter(topping => topping !== undefined) | |
// can also be written as: | |
const tops = Object.values(toppings).filter(Boolean) | |
// e.g Boolean(undefined) => will return false | |
// e.g Boolean(0) => will return false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Providing Context | |
// ================== | |
import React, {useState, useEffect} from "react" | |
const Context = React.createContext() | |
function ContextProvider({children}) { | |
const [allPhotos, setAllPhotos] = useState([]) | |
const [cartItems, setCartItems] = useState([]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Then(/^I should see the following dropdown options$/, (table) => { | |
const expectedOptions = [].concat(...table.raw()); // this array is from the table in the scenario | |
const availableOptions = PaymentDetailsFormComponent.billingCountryOptions // this array will come from the collection of DOM elements | |
.map(option => option.getText()); | |
expect(availableOptions).to.deep.eq(expectedOptions); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Webdriver.IO | |
const [x, y] = Object.values(this.cardPaymentOption.getLocation()); | |
browser.scroll(x, y); | |
this.cardPaymentOption.click(); | |
const [x1, y1] = Object.values(this.ccSecureCheckoutText.getLocation()); | |
browser.scroll(x1, y1); | |
this.ccSecureCheckoutText.waitForVisible(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When(/^there is no hover border displayed$/, () => { | |
const monthlySubscription = | |
SelectSubscription.monthly.plan.selector; | |
function getPsuedoAttributeValues(component, selector, cssProperty) { | |
return window | |
.getComputedStyle(document.querySelector(component), selector) | |
.getPropertyValue(cssProperty); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Global Variables | |
public class hybrid_driver1 { | |
private WebDriver driver; | |
private String baseUrl; | |
private boolean acceptNextAlert = true; | |
private StringBuffer verificationErrors = new StringBuffer(); | |
//Test Case Variables | |
int xRows_TC, xCols_TC; | |
String[][] xData_TC; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.FileOutputStream; | |
import org.apache.poi.hssf.usermodel.HSSFCell; | |
import org.apache.poi.hssf.usermodel.HSSFRow; | |
import org.apache.poi.hssf.usermodel.HSSFSheet; | |
import org.apache.poi.hssf.usermodel.HSSFWorkbook; | |
import org.junit.After; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run test in Internet Explorer | |
File file =new File("C:/Users/Jimi/Selenium/Workspace/IEDriverServer.exe"); | |
System.setProperty("webdriver.ie.driver", file.getAbsolutePath()); | |
WebDriver myD = new InternetExplorerDriver(); |
NewerOlder