Skip to content

Instantly share code, notes, and snippets.

some code for protractor test
some text as well
@kkashyap1707
kkashyap1707 / Conf.js
Last active June 10, 2016 17:06
Configuration File for Protractor Project
/**
* Created by Keshav on 6/9/2016.
* Configuration File Use By Protractor
*
*/
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
getPageTimeout: 95000,
@kkashyap1707
kkashyap1707 / login.po.js
Created June 10, 2016 17:33
login.po.js file is used as an Object Repository where you can add the page objects as well as the actions performed on that objects
/**
* Created by Keshav on 6/9/2016.
* login.po.js file
*/
var loginPage = function(){
var params = browser.params;
//Object Locators
function loginPage()
@kkashyap1707
kkashyap1707 / login.spec.js
Created June 10, 2016 17:36
login.spec.js file is used to create test cases
/**
* Created by Keshav on 6/9/2016.
* login.spec.js file
*/
var loginPage = require('./../fame1/login.po.js');
var beforeScenario=require('./../fame1/beforeTest.js')
describe('FameLiv HomePage', function()
{
{
//Manual Login API
@Test(groups = { "Sanity" })
public void ManualLogin()
{
Keywords object=new Keywords(GlobalProperties.POST_URL+ver,new Login_InputGson(ver).LoginRequest());
String LoginJSONOutput = object.apiMethod_POST();
Login_Response login_Response = new Login_Response();
public String apiMethod_POST()
{
String foutput = "";
try
{
URL url = new URL(uri);
System.out.println("API URL : " + url);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setDoOutput(true);
public String apiMethod_GET()
{
String foutput = "";
try
{
URL url = new URL(uri);
System.out.println("API URL : " + url);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setDoOutput(true);
public static Object GSON(String Input,Class modelClass)
{
Gson gson = new GsonBuilder().setPrettyPrinting().create();
Object object = gson.fromJson(Input, modelClass);
return object;
}
package com.ttn.ResponseJSON;
import com.ttn.Model.Login;
import com.ttn.outputInterface.OutputInterface;
public class Login_Response implements OutputInterface
{
public Object response(Object object)
{
String Message,UserName,CityAddressInfo;