Skip to content

Instantly share code, notes, and snippets.

View hoang-tran's full-sized avatar

Hoang Tran hoang-tran

View GitHub Profile
platform :ios, '9.0'
target 'MyAwesomeProject' do
use_frameworks!
target 'MyAwesomeProjectTests' do
inherit! :search_paths
pod 'Quick'
pod 'Nimble'
end
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'SetupTestingForiOSProject' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for SetupTestingForiOSProject
target 'SetupTestingForiOSProjectTests' do
import KIF
class HomeTests : KIFTestCase {
// test method name MUST have the prefix `test`
// for example: testA, testB, testLogin, ect...
func testHomeScreen() {
visitHomeScreen()
tapOn("button")
expectToSee("Some random label")
import KIF
extension XCTestCase {
func tester(file : String = #file, _ line : Int = #line) -> KIFUITestActor {
return KIFUITestActor(inFile: file, atLine: line, delegate: self)
}
func system(file : String = #file, _ line : Int = #line) -> KIFSystemTestActor {
return KIFSystemTestActor(inFile: file, atLine: line, delegate: self)
}
#import <KIF/KIF.h>
@interface HomeTests : KIFTestCase
@end
#import "HomeTests.h"
@implementation HomeTests
#pragma mark - tests
// test method name MUST have the prefix `test`
// for example: testA, testB, testLogin, ect...
- (void)testHomeScreen {
[self visitHomeScreen];
#import <Specta/Specta.h>
#import <Expecta/Expecta.h>
SpecBegin(MyFirstSpec)
describe(@"first test", ^{
it(@"should pass", ^{
expect(1).to.equal(1);
});
});
import Quick
import Nimble
class MyFirstSpec : QuickSpec {
override func spec() {
super.spec()
describe("first test") {
it("should pass") {
expect(1).to(equal(1))
# command 1: initialize git
git init
# command 2: add all files to git staging
git add .
# command 3: create your first commit with message "create project"
git commit -m "creat project"