Skip to content

Instantly share code, notes, and snippets.

View ajaysuwalka's full-sized avatar

Ajay Suwalka ajaysuwalka

View GitHub Profile
import MySQLdb
from MySQLdb.cursors import DictCursor
from dbutils.pooled_db import PooledDB
from config.db_config import DbConfig
class Mysql(object):
# Connection pool object
__pool = None
# Download BS Binary and store to
wget -q https://www.browserstack.com/browserstack-local/BrowserStackLocal-linux-x64.zip && \
unzip BrowserStackLocal-linux-x64.zip && \
rm BrowserStackLocal-linux-x64.zip && \
chmod +x BrowserStackLocal && \
mv ./BrowserStackLocal /usr/local/BrowserStackLocal
@ajaysuwalka
ajaysuwalka / Read gmail using python
Created July 20, 2020 15:45
Read gmail using python
# Read gmail using python
from googleapiclient.discovery import build
from httplib2 import Http
from oauth2client import file, client, tools
from oauth2client.tools import argparser
import base64
SCOPES = 'https://www.googleapis.com/auth/gmail.readonly'
args = argparser.parse_args()
@ajaysuwalka
ajaysuwalka / gist:5a95892a927258ef1169f4e784d10c3a
Last active September 6, 2019 11:33
Remove branches and Releases
https://help.github.com/en/articles/splitting-a-subfolder-out-into-a-new-repository
https://help.github.com/en/articles/duplicating-a-repository
$ git clone --bare https://github.com/exampleuser/old-repository.git
Create a new repository
$ cd old-repository.git
$ git push --mirror https://github.com/trilogy-group/aurea-aes-edi-test-automation.git
@ajaysuwalka
ajaysuwalka / Google sheet functions
Created July 4, 2019 15:54
Google sheet functions
=IFERROR(IF(MATCH(D14,'#178 - 15.08.2018'!$D:$D,0),"YES",),"NO")
curl https://www.python.org/static/apple-touch-icon-144x144-precomposed.png > example.png
xclip -selection clipboard -t image/png -i example.png
urls.map((us)=>us.split('/').pop()).forEach((key)=>{
var data = JSON.stringify({
"custom_tc_status": 3,
"custom_validation": "Technical Limitation",
"custom_tc_desc": "It requires some desktop part like eclipse to automate which is not supported with current framework. Hence marking ManualExecution",
});
var xhr = new XMLHttpRequest();
@ajaysuwalka
ajaysuwalka / reusable-specs-steps.ts
Last active September 7, 2018 10:46
reusable-specs-steps
// Everything in helper
// Case IDs are exact ones as they are in testrail
// Disadvantages-
// StepId, Step/Verification language might not match in rare case
it('User is able to add new attribute of type TEXT - [15884549]', async () => {
stepLogger.caseId = 15884549;
const name = PageHelper.getUniqueId();
const type = AttributePageConstants.typeOptions.text;
@ajaysuwalka
ajaysuwalka / repeated-specs-steps.ts
Last active September 7, 2018 10:46
repeated-specs-steps
// Everything in spec
// Case IDs are exact ones as they are in testrail
it('User is able to add new attribute - [15877509]', async () => {
stepLogger.caseId = 15884546;
const name = PageHelper.getUniqueId();
const type = AttributePageConstants.typeOptions.checkBox;