Skip to content

Instantly share code, notes, and snippets.

var libxmljs = require("libxmljs");
var xml = [
'<?xml version="1.0" encoding="utf-8"?>',
'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">',
' <soap:Body>',
' <Response xmlns="http://tempuri.org/">',
' <Result>',
' <client xmlns="">',
' <msg>SEARCH OK.</msg>',
' <code>0</code>',
@TuHuynhVan
TuHuynhVan / start.android.emulator.js
Created July 4, 2018 07:42 — forked from wswebcreation/start.android.emulator.js
Start your Android emulator from the command line with a simple questions form
/**
* With this helper you can start emulators from the command line with some easy questions.
* It will automatically list all AVD's that you've configuered on your machine.
*
* NOTE 1: MAKE SURE YOU'VE ADDED inquirer WITH `npm install inquirer --D` TO YOUR DEV DEPENDENCIES
* NOTE 2: MAKE SURE YOU'VE SETUP UP YOUR ENVIRONMENT CORRECTLY WITH ALL THE ENVIRONMENT VARIABLES NEEDED
* FOR MAKING ANDROID WORK ON YOUR MACHINE
* NOTE 3: MAKE SURE YOU'VE SET THE `ANDROID_EMULATOR_PATH` TO THE CORRECT PATH ON YOUR MACHINE
* WHERE ALL THE EMULATORS ARE LISTED
*
@TuHuynhVan
TuHuynhVan / webdriverio.appium.native.swipe.js
Created July 4, 2018 07:03 — forked from wswebcreation/webdriverio.appium.native.swipe.js
This gist holds some methods I use to do swiping on iOS and Android
/**
* Here you'll find some swipe methods for a native iOS or Android app
* which can be used when you are using webdriver.io
*
* I work a lot based on percentages, so it is working on all screens and all devices
* and I hope you understand how to use it based on the docs.
*
* Feel free to use it for all kinds of purposes, a star is much appreciated ;-)
*
* Grtz,
@TuHuynhVan
TuHuynhVan / gist:2545eafab34c2c324339afe0fcce096a
Created March 2, 2018 02:55 — forked from andyyou/gist:3052671
C# Controls abbreviation
btn Button chk CheckBox ckl CheckedListBox
cmb ComboBox dtp DateTimePicker lbl Label
llb LinkLabel lst ListBox lvw ListView
mtx MaskedTextBox cdr MonthCalendar icn NotifyIcon
nud NumeircUpDown pic PictureBox prg ProgressBar
rdo RadioButton rtx RichTextBox txt TextBox
tip ToolTip tvw TreeView wbs WebBrowser
容器
flp FlowLayoutPanel grp GroupBox pnl Panel
@TuHuynhVan
TuHuynhVan / README-Template.md
Created December 26, 2017 12:19 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@TuHuynhVan
TuHuynhVan / .gitignore
Created December 1, 2017 02:06 — forked from smebberson/.gitignore
Express simple authentication example
node_modules
*.swp
@TuHuynhVan
TuHuynhVan / better-nodejs-require-paths.md
Created October 10, 2017 12:42 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

var Article = require('../../../models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@TuHuynhVan
TuHuynhVan / e2e-shadowdom.md
Created August 24, 2017 08:14 — forked from ChadKillingsworth/e2e-shadowdom.md
Selenium Testing with Shadow DOM

End-to-end Testing with Shadow DOM

As the web component specs continue to be developed, there has been little information on how to test them. In particular the /deep/ combinator has been deprecated in Shadow DOM 1.0. This is particularly painful since most end-to-end testing frameworks rely on elements being discoverable by XPath or calls to querySelector. Elements in Shadow DOM are selectable by neither.

WebDriver.io

Webdriver.io has the standard actions by selectors, but also allows browser executable scripts to return an element

@TuHuynhVan
TuHuynhVan / actionsApi.txt
Created August 11, 2017 11:58 — forked from maggiesavovska/actionsApi.txt
Summary of sendKeys() and moveTo() Issues
Bunch of stuff broken? Don't fear..the Actions API is on it's way and it will probably be a good thing! Chin up!
OVERVIEW:
The purpose of this document is to explain the new actions API and what it has to do with certain commands
such as moveto and keys being depricated in webdriverio (due to them being deprecated in certain browser drivers).
MAIN ISSUE:
1. The issue is that these new drivers suppress these commands on purpose because they are deprecated,
but the drivers have not yet implemented the new WC3 standard called "actions API".
"The user-facing API for emulating complex user gestures. Use this class rather than using the Keyboard or Mouse directly."
@TuHuynhVan
TuHuynhVan / mocha-guide-to-testing.js
Created July 27, 2017 04:02 — forked from samwize/mocha-guide-to-testing.js
Explain Mocha's testing framework - describe(), it() and before()/etc hooks
// # Mocha Guide to Testing
// Objective is to explain describe(), it(), and before()/etc hooks
// 1. `describe()` is merely for grouping, which you can nest as deep
// 2. `it()` is a test case
// 3. `before()`, `beforeEach()`, `after()`, `afterEach()` are hooks to run
// before/after first/each it() or describe().
//
// Which means, `before()` is run before first it()/describe()