Skip to content

Instantly share code, notes, and snippets.

View rajaraodv's full-sized avatar

Raja Rao DV rajaraodv

View GitHub Profile
# Note: This is just an example in Python. This shows how to print and also how to call that method.
# Feel free to change it to your language and framework needs
import softest
# Get the browser, viewport and device info from a variable like below or from a file or environment variable.
browser = "Firefox"
viewport = "1200X700"
device = "Laptop"
//Note: This is just an example in .Net C#. This shows how to print and also how to call that method.
//Feel free to change it to your language and framework needs
using NUnit.Framework;
using OpenQA.Selenium;
using System.IO;
namespace HackathonReport3
{
[TestFixture()]
@rajaraodv
rajaraodv / hackathon.rb
Created May 22, 2020 19:04
UFG Hackathon example reporter code
# Note: This is just an example in Ruby. This shows how to print and also how to call that method.
# Feel free to change it to your language and framework needs
# Execute example: $ rspec hackathon.rb -f documentation
require 'rspec'
# A Helper to print the test result in the following format:
# Task: <Task Number>, Test Name: <Test Name>, DOM Id:: <id>, Browser: <Browser>, Viewport: <Width x Height>, Device<Device type>, Status: <Pass | Fail>
#
//----------------------------------------------------------------------
//CASE 1: Test Login page (BEFORE):
//-----------------------------------------------------------------------
//Lots of code to test a simple login page
@Test
public void loginTest() {
//Open browser
driver.get("https://demo.applitools.com/loginBefore.html");
@Test
public void loginTest() {
//Open browser
driver.get("https://demo.applitools.com/loginBefore.html");
//Click on the Login button
driver.findElement(By.id("log-in")).click();
//Assert the error text
assertEquals("Please enter username and password",
@Test
public void loginTest() {
//Open browser
driver.get("https://demo.applitools.com/loginBefore.html");
//Click on the Login button
driver.findElement(By.id("log-in")).click();
//Start the test
eyes.open(driver, "Login App", "Login Page Test");