Skip to content

Instantly share code, notes, and snippets.

View kuronekomichael's full-sized avatar
🤡
“You cheated not only the game, but yourself"

Koki Nakashima kuronekomichael

🤡
“You cheated not only the game, but yourself"
View GitHub Profile
@kuronekomichael
kuronekomichael / subl.scpt
Created October 22, 2013 07:49
Sublime Text 2でメニューから行を選択してカットするApple Script -- applescript, apple script AppleScript
-- Sublime Text 2をアクティブにする
tell application "Sublime Text 2"
activate
end tell
-- Sublime Text 2の現在行を選択して、切り出す
tell application "System Events"
@kuronekomichael
kuronekomichael / wordRegister.scpt
Last active March 14, 2022 08:45
ことえり単語登録に文字を入力するApple Script -- appleScript, apple script, AppleScript
-- ことえり単語登録(== "WordRegister")
tell application "WordRegister"
activate
end tell
tell application "System Events"
-- 単語の欄にペースト
@kuronekomichael
kuronekomichael / migrate_selenium1.js
Created December 13, 2013 10:14
Selenium RCからWebDriverに移行するための、シンプルな4つの手順
// Selenium RCの場合
selenium.chooseCancelOnNextConfirmation();
selenium.click("id=foo");
// WebDriverの場合
webdriver.findElement(By.id("foo")).click();
webdriver.switchTo().alert().dismiss();
@kuronekomichael
kuronekomichael / migrate_selenium2.js
Created December 13, 2013 10:16
Selenium RCからWebDriverに移行するための、シンプルな4つの手順
// Selenium RCの場合 => openの後waitが必要
selenium.open("http://www.google.com");
selenium.waitForPageToLoad();
selenium.typeKeys("name=q", "bears");
// WebDriverの場合 => openの中で暗黙的にwaitしているので、わざわざ記述は要らない
selenium.open("http://www.google.com");
selenium.typeKeys("name=q", "bears");
@kuronekomichael
kuronekomichael / migrate_selenium3.js
Created December 13, 2013 10:16
Selenium RCからWebDriverに移行するための、シンプルな4つの手順
// 良くない例:<body>の中のテキストを全て取得して検証している
String text = selenium.getBodyText();
assertTrue(text.contains("hello"));
WebElement body = webdriver.findElement(
By.tagName("body"));
String text = body.getText();
assertTrue(text.contains("hello"));
@kuronekomichael
kuronekomichael / migrate_selenium4.js
Created December 13, 2013 10:17
Selenium RCからWebDriverに移行するための、シンプルな4つの手順
selenium.getEval(
"selenium.isElementPresent('id=foo') && " +
"selenium.isVisible('id=foo')");
@kuronekomichael
kuronekomichael / 0_reuse_code.js
Created December 21, 2013 06:05
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@kuronekomichael
kuronekomichael / uiautomation_js_reference.md
Last active November 27, 2015 09:14
UIAutomation JavaScript Reference

UIAutomation JavaScript Reference 日本語版

based on UIAutomationRef.pdf

Accessing and Using User Interface Elements

エレメントは階層構造になっている UIATarget.localTarget()を最上位とする

#!/bin/bash
# [usage]
# instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument ...]]]
# --- 環境設定
APP_NAME=<TargetAppName>
# for 7.0.3-64
#SIMULATOR_VERSION=7.0.3-64
#GUID=9BAC4C3E-BBC2-4805-A115-A310CB21A941
@kuronekomichael
kuronekomichael / _helper.js
Last active August 29, 2015 14:02
mocha/chaiでテストを書くときにいつものセット(mocha.opts, _helper.js)
global.expect = require('chai').expect;
global.sinon = require('sinon').expect;
// clear console
process.stdout.write('\u001b[2J\u001b[0;0H');