ひょうたん/キュウリのテストで、iOS のアラートビューのテキストにアクセスするにはどうすればよいですか?
NSString *msgString = [NSString stringWithFormat:@"No: %@\n Latitude: %f\n Longitude: %f", wrapper.no, wrapper.latitude, wrapper.longitude];
UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:@"Really reset?" message:@"msgString" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil] autorelease];
// optional - add more buttons:
[alert addButtonWithTitle:@"Yes"];
[alert show];
アラートに期待される内容があることを主張したい:
Feature: Running a test
As a user using a phone connected to the internet
I want to have correct sample data retrieved from cache or net
So I can read the values of the tableview
Scenario: Testing retrieved data
Given the app is running
Then I press "Refresh"
Then I should see "Some value"
Then I press "Some value"
Then I should /*See an alert with "myMessage"*/
Then I press "OK"
And take picture
したがって、文字列を単純に「いいえ:」に変更し、文字列から他のすべてを破棄すると、実際には機能しているように見えますが、より複雑な文字列で実行することはできません:(