Label: label macro needs act_ prefix to avoid namespace conflicts
This commit is contained in:
Родитель
07d356b23c
Коммит
4abcfb35aa
|
@ -12,7 +12,7 @@
|
|||
Objective-C
|
||||
*/
|
||||
+ (void)label:(NSString *)fmt, ...;
|
||||
#define label(...) [ACTLabel label: __VA_ARGS__]
|
||||
#define act_label(...) [ACTLabel label: __VA_ARGS__]
|
||||
|
||||
/*
|
||||
Swift or Objective-C
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
}
|
||||
|
||||
- (void)testACTLabelMacroUsingObjectiveC {
|
||||
label(@"label macro can be called without arguments");
|
||||
label(@"label macro can be called with arguments - %@, %@, %@",
|
||||
act_label(@"act_label macro can be called without arguments");
|
||||
act_label(@"act_label macro can be called with arguments - %@, %@, %@",
|
||||
@"ARG0", @(1), @(2.3));
|
||||
XCTAssertTrue(YES, "This test should always pass");
|
||||
}
|
||||
|
@ -38,22 +38,22 @@
|
|||
|
||||
- (void)testToggleScreenshots {
|
||||
[self.app.buttons[@"Circle"] tap];
|
||||
label(@"When I see the Circle tab");
|
||||
act_label(@"When I see the Circle tab");
|
||||
|
||||
XCTAssertNotNil(self.app.images[@"flowers-in-circle"]);
|
||||
label(@"Then I see the flowers in a circle");
|
||||
act_label(@"Then I see the flowers in a circle");
|
||||
|
||||
[self.app.buttons[@"Square"] tap];
|
||||
label(@"When I touch the Square tab");
|
||||
act_label(@"When I touch the Square tab");
|
||||
|
||||
XCTAssertNotNil(self.app.images[@"flowers-in-square"]);
|
||||
label(@"Then I see the flowers in a square");
|
||||
act_label(@"Then I see the flowers in a square");
|
||||
|
||||
[self.app.buttons[@"Circle"] tap];
|
||||
label(@"When I see the Circle tab");
|
||||
act_label(@"When I see the Circle tab");
|
||||
|
||||
XCTAssertNotNil(self.app.images[@"flowers-in-circle"]);
|
||||
label(@"Then I see the flowers in a circle");
|
||||
act_label(@"Then I see the flowers in a circle");
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
- (void)testACTLaunchClassMethodUsingObjectiveC {
|
||||
XCUIApplication *application = [ACTLaunch launch];
|
||||
label(@"Given the app launched using ACTLabel.launch from ObjC");
|
||||
act_label(@"Given the app launched using ACTLabel.launch from ObjC");
|
||||
XCTAssertNotNil(application);
|
||||
XCUIApplicationState state = [ACTLaunch stateForApplication:application];
|
||||
XCTAssertFalse(state == XCUIApplicationStateUnknown);
|
||||
|
@ -38,7 +38,7 @@
|
|||
XCTAssertNotNil(application);
|
||||
|
||||
XCUIApplication *launched = [ACTLaunch launchApplication:application];
|
||||
label(@"Given the app launched using ACTLabel.launchApplication from ObjC");
|
||||
act_label(@"Given the app launched using ACTLabel.launchApplication from ObjC");
|
||||
XCTAssertEqualObjects(application, launched,
|
||||
@"Expected .launchApplication: to return the"
|
||||
"application it was passed as an argument.");
|
||||
|
@ -51,7 +51,7 @@
|
|||
- (void)testACTLaunchMacroUsingObjectiveC {
|
||||
XCUIApplication *application = act_launch;
|
||||
XCTAssertNotNil(application);
|
||||
label(@"Given the app launched using act_launch macro");
|
||||
act_label(@"Given the app launched using act_launch macro");
|
||||
XCUIApplicationState state = [ACTLaunch stateForApplication:application];
|
||||
XCTAssertFalse(state == XCUIApplicationStateUnknown);
|
||||
[application terminate];
|
||||
|
@ -62,7 +62,7 @@
|
|||
XCTAssertNotNil(application);
|
||||
|
||||
XCUIApplication *launched = act_launch_app(application);
|
||||
label(@"Given the app launched using act_launch_app macro");
|
||||
act_label(@"Given the app launched using act_launch_app macro");
|
||||
XCTAssertEqualObjects(application, launched,
|
||||
@"Expected .launchApplication: to return the"
|
||||
"application it was passed as an argument.");
|
||||
|
|
|
@ -104,10 +104,10 @@ function expect_log_text {
|
|||
info "Checking log file for expected text"
|
||||
|
||||
# Label methods
|
||||
expect_log_text "label macro can be called without arguments"
|
||||
expect_log_text "label macro can be called with arguments - ARG0, 1, 2.3"
|
||||
expect_log_text "label class method can be called without arguments"
|
||||
expect_log_text "label class method can be called with arguments - ARG0, 1, 2.3"
|
||||
expect_log_text "act_label macro can be called without arguments"
|
||||
expect_log_text "act_label macro can be called with arguments - ARG0, 1, 2.3"
|
||||
expect_log_text "Given the app has launched"
|
||||
expect_log_text "Then I touch the red button 3 times"
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче