Skip to content

Instantly share code, notes, and snippets.

View yucer's full-sized avatar

Yurdik Cervantes yucer

View GitHub Profile
@yucer
yucer / debug-smtpd
Created February 11, 2016 16:26 — forked from tachesimazzoca/debug-smtpd
Python SMTP Debugging Server #python
#!/usr/bin/python
import asyncore
import logging
import smtpd
import sys
log = logging.getLogger('debug-smtpd')
class LoggingSMTPServer(smtpd.SMTPServer):
@yucer
yucer / selenium_new_tab.py
Created August 2, 2017 13:35
Script to test opening new tab with selenium RemoteWebDriver
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import time
import tempfile
import logging
@yucer
yucer / Newtab.java
Last active August 8, 2017 10:15
Open new tab with selenium in Java (plus profile and capabilities)
package automationFramework;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.logging.Level;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
@yucer
yucer / bash_fs_watcher_inotify.sh
Created August 3, 2017 08:46
filesystem watcher with inotify-tools
# sudo apt-get install inotify-tools
watch_dir ()
{
inotifywait -m $1 -e create -e moved_to | while read path action file; do
echo "The file '$file' appeared in directory '$path' via '$action'";
done
}
# usage example:
@yucer
yucer / test_key_newtabs.py
Last active August 9, 2017 08:31
Marionette tests scripts for opening new tabs with legacy key combinations
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# locate the test script in mozilla-central repository
# path: testing/marionette/harness/marionette_harness/tests/unit/test_key_newtabs.py
#
# and tun it via:
#
# ./mach marionette-test testing/marionette/harness/marionette_harness/tests/unit/test_key_newtabs.py -vv --gecko-log -
@yucer
yucer / test_selenium_ctrl_key.java
Last active August 9, 2017 09:25
Test sendKeys with CONTROL using Selenium Java
package automationFramework;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.logging.Level;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
@yucer
yucer / test_selenium_ctrl_key.java.log
Created August 9, 2017 09:14
Test sendKeys with CONTROL using Selenium Java (LOG)
Opening new Tab
webdriver::server DEBUG -> POST /session/cf7cca51-aeb8-4d18-b52a-ce6e7ef7f0d4/element/b1c10055-c301-4892-930c-2e1859fb13d9/value {"id":"b1c10055-c301-4892-930c-2e1859fb13d9","text":"abcdef","value":["a","b","c","d","e","f"]}
geckodriver::marionette TRACE -> 121:[0,5,"sendKeysToElement",{"id":"b1c10055-c301-4892-930c-2e1859fb13d9","text":"abcdef","value":["a","b","c","d","e","f"]}]
Marionette TRACE 0 -> [0,5,"sendKeysToElement",{"id":"b1c10055-c301-4892-930c-2e1859fb13d9","text":"abcdef","value":["a","b","c","d","e","f"]}]
geckodriver::marionette TRACE <- [1,5,null,{}]
Marionette TRACE 0 <- [1,5,null,{}]
webdriver::server DEBUG <- 200 OK {"value": {}}
webdriver::server DEBUG -> POST /session/cf7cca51-aeb8-4d18-b52a-ce6e7ef7f0d4/element/b1c10055-c301-4892-930c-2e1859fb13d9/value {"id":"b1c10055-c301-4892-930c-2e1859fb13d9","text":"z12345","value":["","z","","1","2","3","4","5"]}
geckodriver::marionette TRACE -> 139:[0,6,"sendKeysToElement",{"id":"b1c10055-c301-4892-930c-2e1859fb13d9","text":
@yucer
yucer / test_selenium_ctrl_t.java.log
Created August 9, 2017 09:16
Test sendKeys with CONTROL + T using Selenium Java (LOG)
IOpening new Tab
webdriver::server DEBUG -> POST /session/95eafc26-5064-4038-9abd-77cfa38d0c97/element/d36aa8a9-5ab2-4bc3-a951-fec6e7bd6163/value {"id":"d36aa8a9-5ab2-4bc3-a951-fec6e7bd6163","text":"abcdef","value":["a","b","c","d","e","f"]}
geckodriver::marionette TRACE -> 121:[0,5,"sendKeysToElement",{"id":"d36aa8a9-5ab2-4bc3-a951-fec6e7bd6163","text":"abcdef","value":["a","b","c","d","e","f"]}]
Marionette TRACE 0 -> [0,5,"sendKeysToElement",{"id":"d36aa8a9-5ab2-4bc3-a951-fec6e7bd6163","text":"abcdef","value":["a","b","c","d","e","f"]}]
Marionette TRACE 0 <- [1,5,null,{}]
geckodriver::marionette TRACE <- [1,5,null,{}]
webdriver::server DEBUG <- 200 OK {"value": {}}
webdriver::server DEBUG -> POST /session/95eafc26-5064-4038-9abd-77cfa38d0c97/element/d36aa8a9-5ab2-4bc3-a951-fec6e7bd6163/value {"id":"d36aa8a9-5ab2-4bc3-a951-fec6e7bd6163","text":"t","value":["","t",""]}
geckodriver::marionette TRACE -> 114:[0,6,"sendKeysToElement",{"id":"d36aa8a9-5ab2-4bc3-a951-fec6e7bd6163","text":"t","value":["","t","
@yucer
yucer / test_selenium_ctrl_t.java
Created August 9, 2017 09:18
Test sendKeys with CONTROL + T using Selenium Java
package automationFramework;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.logging.Level;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
@yucer
yucer / test_selenium_ctrl_t_e10s_disabled.java
Created August 11, 2017 08:50
Test sendKeys with CONTROL + T using Selenium Java with Electrolysis disabled
package automationFramework;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.logging.Level;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;