mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-23 22:09:25 +00:00
Added support for {DELAY=<delay>} to allow for custom delay in command execution instead of using dedicated UI and settings for this
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
[super tearDown];
|
||||
}
|
||||
|
||||
- (void)testValidDelayCommands {
|
||||
- (void)testLocalDelayCommands {
|
||||
/* Command 1 */
|
||||
MPAutotypeContext *context = [[MPAutotypeContext alloc] initWithEntry:self.entry andSequence:@"{DELAY 200}"];
|
||||
NSArray *commands = [MPAutotypeCommand commandsForContext:context];
|
||||
@@ -41,8 +41,23 @@
|
||||
XCTAssertTrue([commands.firstObject isKindOfClass:[MPAutotypeDelay class]], @"Command is Delay command");
|
||||
MPAutotypeDelay *delay = commands.firstObject;
|
||||
XCTAssertEqual(delay.delay, 200, @"Delay is 200 ms");
|
||||
XCTAssertFalse(delay.isGlobal, @"Delay is no global delay");
|
||||
}
|
||||
|
||||
- (void)testGlobalDelayCommands {
|
||||
/* Command 1 */
|
||||
MPAutotypeContext *context = [[MPAutotypeContext alloc] initWithEntry:self.entry andSequence:@"{DELAY=200}"];
|
||||
NSArray *commands = [MPAutotypeCommand commandsForContext:context];
|
||||
|
||||
XCTAssertEqual(commands.count, 1);
|
||||
/* {DELAY=200} */
|
||||
XCTAssertTrue([commands.firstObject isKindOfClass:MPAutotypeDelay.class], @"Command is Delay command");
|
||||
MPAutotypeDelay *delay = commands.firstObject;
|
||||
XCTAssertEqual(delay.delay, 200, @"Delay is 200 ms");
|
||||
XCTAssertTrue(delay.isGlobal, @"Delay is global delay");
|
||||
}
|
||||
|
||||
|
||||
- (void)testDelayExecution {
|
||||
MPAutotypeDelay *delay = [[MPAutotypeDelay alloc] initWithDelay:200];
|
||||
XCTestExpectation *expectation = [self expectationWithDescription:delay.description];
|
||||
|
||||
Reference in New Issue
Block a user