excase

package module
v0.0.0-...-4025506 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2017 License: MIT Imports: 5 Imported by: 0

README

excase

Excelファイルにテストケースと結果を出力するためのライブラリ

godoc CircleCI go report

Description

Excelファイルにテストケースと結果を出力するために使用する 大項目、中項目、小項目、テストケース、合格条件、合否、実行日時などを設定すると テストケースと合否を出力することができる

Usage

// ケースの作成準備
ex := excase.InitExCase()
// ケースの作成
sec := ex.OpenSection("テストシート名")
// 大項目のセット
sec.Large("大項目1")
// 中項目のセット
sec.Middle("中項目1-1")
// 小項目のセット
sec.Small("小項目1-1-1")
// テストの内容と合格条件をセット
test := sec.Test("テスト内容1-1-1-1", "合格条件1-1-1-1")
// 合格をセット
test.Passed()
// 次の行に小項目とテスト内容と合格条件のみセット
sec.Small("小項目1-1-2")
test = sec.Test("テスト内容1-1-1-2", "合格条件1-1-1-2")
// 不合格をセット
test.Failed()
// チェーンして書くことも可能
sec.Middle("中項目1-2").Small("小項目1-2-1").Test("テスト内容1-2-1-1", "合格条件1-2-1-1").Passed()
// セクションを閉じる
sec.CloseSection()
// テスト出力終了
ex.Close()

出力イメージ top-page

作成されるファイルのパスを確認する[ex.FilePath]に保管されてる

ex := excase.InitExCase()
fmt.Println(ex.FilePath)
ex.Close()

Install

$ go get github.com/loadoff/excl
$ go get github.com/loadoff/excase

Licence

MIT

Author

YuIwasaki

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExCase

type ExCase struct {
	FilePath string
	// contains filtered or unexported fields
}

ExCase テストケース

func InitExCase

func InitExCase() *ExCase

InitExCase Excelテストケースを作成する

func (*ExCase) Close

func (ex *ExCase) Close()

Close 閉じる

func (*ExCase) OpenSection

func (ex *ExCase) OpenSection(name string) *ExSection

OpenSection 新しいシートにテストを出力する

type ExSection

type ExSection struct {
	// contains filtered or unexported fields
}

ExSection セクション情報

func (*ExSection) CloseSection

func (ex *ExSection) CloseSection()

CloseSection セクションを閉じる

func (*ExSection) Large

func (ex *ExSection) Large(name string) *ExSection

Large 大項目をセット

func (*ExSection) Middle

func (ex *ExSection) Middle(name string) *ExSection

Middle 中項目をセット

func (*ExSection) Small

func (ex *ExSection) Small(name string) *ExSection

Small 小項目をセット

func (*ExSection) Test

func (ex *ExSection) Test(content string, pass string) *ExTest

Test テストの内容と合格条件をセットする

type ExTest

type ExTest struct {
	// contains filtered or unexported fields
}

ExTest テストの出力行

func (*ExTest) Failed

func (test *ExTest) Failed() *ExTest

Failed 不合格をセット

func (*ExTest) Info

func (test *ExTest) Info(info string) *ExTest

Info 補足情報をセットする

func (*ExTest) Passed

func (test *ExTest) Passed() *ExTest

Passed 合格をセット

func (*ExTest) Unexecuted

func (test *ExTest) Unexecuted() *ExTest

Unexecuted 未実施をセット

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL