Skip to content

Instantly share code, notes, and snippets.

Avatar

Ravindra Naik naik899

View GitHub Profile
@naik899
naik899 / nightwatch.json
Created May 16, 2020
Experitest cloud Night Watch Json configuration
View nightwatch.json
{
"src_folders" : ["./tests"],
"output_folder" : "./reports",
"test_workers": {
"enabled": true,
"workers": "auto"
},
"selenium" : {
"start_process" : false,
"server_path" : "",
@naik899
naik899 / nightwatchGoogleSearch.js
Created May 16, 2020
Night watch Google search JS script
View nightwatchGoogleSearch.js
module.exports = {
'NW test on Google' : function (client) {
client
.url('http://www.google.com')
.waitForElementVisible('body', 1000)
.assert.title('Google')
.assert.visible('input[type=text]')
.setValue('input[type=text]', 'Nightwatch JS')
.waitForElementVisible('button[name=btnG]', 1000)
.click('button[name=btnG]')
@naik899
naik899 / nightwatch.json
Last active May 16, 2020
Nightwatch json configuration file
View nightwatch.json
{
"src_folders" : ["tests"],
"output_folder" : "reports",
"test_workers": {
"enabled": true,
"workers": "auto"
},
"selenium" : {
"start_process" : true,
"server_path" : "node_modules/selenium-standalone/.selenium/selenium-server/",
@naik899
naik899 / seleniumwdio.config.txt
Created Apr 27, 2020
Selenium WDIO config file for Experitest cloud
View seleniumwdio.config.txt
exports.config = {
runner: 'local',
hostname: 'CLOUDURL',// e.g., demo.experitest.com
protocol: 'https',
port: 443,
services: ['appium'],
path: '/wd/hub',
specs: [
'./test/specs/**/*.js'
@naik899
naik899 / helloworld.txt
Last active Apr 27, 2020
Web driver test for Experitest.com
View helloworld.txt
const assert = require('assert')
describe('webdriver.io page', () => {
it('should have the right title', () => {
browser.url('https://experitest.com')
const title = browser.getTitle()
assert.strictEqual(title, 'Experitest: Mobile App & Cross-Browser Testing End-to-End')
})
})
View calendarinvite.txt
using Ical.Net;
using Ical.Net.DataTypes;
using Ical.Net.Serialization.iCalendar.Serializers;
using Ical.Net.Serialization;
...
...
...
MailMessage message = new MailMessage();
message.To.Add("naik899@gmail.com");
@naik899
naik899 / MyCorsPolicy.txt
Created Mar 22, 2019
Create a custom cors policy to allow dynamic list of origins in Asp.Net
View MyCorsPolicy.txt
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = false)]
public class MyCorsPolicy : Attribute, ICorsPolicyProvider
{
private CorsPolicy _policy;
public MyCorsPolicy()
{
// Create a CORS policy.
_policy = new CorsPolicy
{
@naik899
naik899 / TestController.txt
Created Mar 22, 2019
Test Controller with origin changes
View TestController.txt
using System.Net.Http;
using System.Web.Http;
using System.Web.Http.Cors;
[EnableCors(origins: "http://ravindranaik.com", headers: "*", methods: "*")]
public class TestController : ApiController
{
// ...
}
@naik899
naik899 / WebApiConfig.Txt
Created Mar 22, 2019
WebApiConfig to enable cors
View WebApiConfig.Txt
using System.Web.Http;
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
//Enable CORS - Add this line
config.EnableCors();
// Web API routes
@naik899
naik899 / txt
Created Mar 8, 2019
HttpModule
View txt
using System;
using System.Web;
namespace HtmlMinification
{
public class HttpModule : IHttpModule
{
void IHttpModule.Init(HttpApplication context)
{
context.BeginRequest += ContextBeginRequest;