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
const { IncomingWebhook } = require('@slack/client'); | |
let sendToSlack; | |
const t = () => (new Date()).toISOString(); | |
if (process.env.SLACK_LOGGING_WEBHOOK_URL) { | |
const slack = new IncomingWebhook(process.env.SLACK_LOGGING_WEBHOOK_URL); | |
const handler = err => { | |
if (err) { |
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
const http = require('http'); | |
const readline = require('readline'); | |
const HTML_PAGE = `<!doctype html> | |
<html> | |
<head> | |
<title>File upload testing</title> | |
<meta charset="utf-8"> | |
<script> | |
function handleSubmit(e) { |
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
// Create the instance | |
var request = new Request.Stocks({ | |
// Stocks to retrieve | |
stocks: ["VTI","AMZN"], | |
// Formatter upon result | |
onComplete: function(result) { | |
var quotes = result && result.query && result.query.results && result.query.results.quote; | |
if(!quotes) return; | |
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
mvn archetype:generate \ | |
-DarchetypeGroupId=com.github.jsdevel \ | |
-DarchetypeArtifactId=testng-selenium-archetype |
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
@Test @UserAgent("some new user agent") | |
public void verify_that_we_can_override_a_user_agent() { | |
// hooray! | |
} |
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
package com.github.jsdevel.testng.selenium.samples; | |
import com.github.jsdevel.testng.selenium.AbstractPage; | |
import java.net.URL; | |
import org.openqa.selenium.WebElement; | |
import org.openqa.selenium.support.FindBy; | |
public class GoogleHomePage extends AbstractPage<GoogleHomePage, SamplePageFactory> { | |
@FindBy(css = "[name=q]") | |
public WebElement q; |
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
package my.project; | |
import com.github.jsdevel.testng.selenium.PageFactory; | |
public interface MyPageFactory extends PageFactory { | |
MyHomePage getHomePage(); | |
MyHomePage getHomePage(String path); | |
} |
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
<dependency> | |
<groupId>com.github.jsdevel</groupId> | |
<artifactId>testng-selenium</artifactId> | |
<!-- Change this to the version you wish to use. --> | |
<version>RELEASE</version> | |
</dependency> |
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
package my.project; | |
import org.testng.annotations.Test; | |
import com.github.jsdevel.testng.selenium.AbstractSuite; | |
public class SampleSuiteITest extends AbstractSuite<MyPageFactory> { | |
@Test | |
public void we_should_be_able_to_view_the_home_page() { | |
getPageFactory().getHomePage(); |
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
describe('the home page', function() { | |
it('should allow users to search', function() { | |
pageFactory.getHomePage() | |
.get() | |
.doSomethingOnTheHomePage() | |
.clickSearchWidgetSubmitButton() | |
.doSomethingElseOnTheHomePage() | |
; | |
}); | |
}); |
NewerOlder