Skip to content

Instantly share code, notes, and snippets.

@siguremon
siguremon / build.xml
Created May 28, 2013 10:08
Antのプロパティの指定方法(タスク、プロパティファイル、コマンドライン引数) ref: http://qiita.com/items/e26a13f73bc8e3b7a6db
<?xml version="1.0"?>
<project name="SimpleAnt" default="compile">
<property file="file.properties" />
<property name="msg" value="Hello world" />
<target name="compile">
<echo>${msg}</echo>
</target>
<target name="test" depends="compile">
<echo>testだけど表示するだけで何もしない</echo>
</target>
@siguremon
siguremon / file1.txt
Created May 18, 2013 06:48
Ruby on Railsとfllcalendar pluginでGoogleカレンダークローンを作る(3) ref: http://qiita.com/items/fe8546579144f3a51937
bundle install --path/vendor
@siguremon
siguremon / practical_selenium.md
Created May 16, 2013 08:40
実践Selenium入門

実践Selenium入門

Selenium概要 なぜブラウザテストを自動化するのか

Selenium IDE キャプチャ&リプレイによるシンプルな自動テスト

Selenium IDEのインストール

操作を記録する

記録した操作を実行する

要素を指定する(セレクタ)

IDEのコマンド

@siguremon
siguremon / new_gist_file
Created May 9, 2013 02:01
fullCalendarメモ
+ 週表示のときに、イベントのリサイズが日をまたげない
+ イベントのリサイズが1方向(右方向または下方向)にしかできない
@siguremon
siguremon / calendar.js
Created May 4, 2013 18:17
Ruby on Railsとfullcalendar pluginでGoogleカレンダークローンを作る(2) ref: http://qiita.com/items/10216d15471dfe5ba572
$(document).ready(function() {
var select = function(start, end, allDay) {
var title = window.prompt("title");
var data = {event: {title: title,
start: start,
end: end,
allDay: allDay}};
$.ajax({
type: "POST",
url: "/events",
@siguremon
siguremon / Gemfile
Last active December 16, 2015 16:09
Ruby on Railsとfullcalendar pluginでGoogleカレンダークローンを作る(1) ref: http://qiita.com/siguremon/items/73651af19babd22fe012
source 'https://rubygems.org'
gem 'rails', '4.1.8'
gem 'sqlite3'
gem 'fullcalendar-rails'
gem 'momentjs-rails'
gem 'uglifier'
gem 'jquery-rails'
@siguremon
siguremon / file0.java
Created December 8, 2012 07:02
webdriverでウィンドウサイズを変更する ref: http://qiita.com/items/bfede5cebc3c9996b7aa
// 指定のウィンドウサイズに変更
int width = 1000;
int height = 500;
driver.manage().window().setSize(new Dimension(width, height));
// 最大化
driver.manage().window().maximize();
@siguremon
siguremon / file0.java
Created December 8, 2012 06:54
webdriverでスクリーンキャプチャ ref: http://qiita.com/items/34e8d443c543a5ff0591
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
File tmpFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
try {
FileUtils.copyFile(tmpFile, new File("tmp.png"));
} catch (IOException e) {
e.printStackTrace();
}
package SeleniumSample;
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.*;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

IntelliJ IDEAでTDDするためのメモ(Mac:Java:Junit ver)

よく使うショートカット

  • Alt+Enter Quick Fix 補完
  • Command+shift+T Go to Test テストクラス・対象クラス間を移動。対応するテストクラスがない場合には生成ダイアログを表示
  • Alt+shift+F10 Run Test テストクラスまたはテストメソッドを実行

テストクラスの作り方

対象クラス→テストクラスの順で作る

  • ソースフォルダ右クリック→[New]→[Java Class]で対象クラスを作成
  • Command+shift+T→[Create New Test]でテストクラス作成ダイアログからテストクラスを作成