This repository has been archived by the owner on Dec 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation and bump version to 1.0.0.
- Loading branch information
Dag Ågren
committed
Nov 28, 2016
1 parent
65548ec
commit 677b188
Showing
64 changed files
with
8,543 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
.DS_Store | ||
.build | ||
build | ||
xcuserdata | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>Classes Reference</title> | ||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" /> | ||
<link rel="stylesheet" type="text/css" href="css/highlight.css" /> | ||
<meta charset='utf-8'> | ||
<script src="js/jquery.min.js" defer></script> | ||
<script src="js/jazzy.js" defer></script> | ||
|
||
</head> | ||
<body> | ||
<a title="Classes Reference"></a> | ||
<header> | ||
<div class="content-wrapper"> | ||
<p><a href="index.html"> Docs</a> (100% documented)</p> | ||
</div> | ||
</header> | ||
<div class="content-wrapper"> | ||
<p id="breadcrumbs"> | ||
<a href="index.html"> Reference</a> | ||
<img id="carat" src="img/carat.png" /> | ||
Classes Reference | ||
</p> | ||
</div> | ||
<div class="content-wrapper"> | ||
<nav class="sidebar"> | ||
<ul class="nav-groups"> | ||
<li class="nav-group-name"> | ||
<a href="Classes.html">Classes</a> | ||
<ul class="nav-group-tasks"> | ||
<li class="nav-group-task"> | ||
<a href="Classes/Monkey.html">Monkey</a> | ||
</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</nav> | ||
<article class="main-content"> | ||
<section> | ||
<section class="section"> | ||
<h1>Classes</h1> | ||
<p>The following classes are available globally.</p> | ||
|
||
</section> | ||
<section class="section task-group-section"> | ||
<div class="task-group"> | ||
<ul> | ||
<li class="item"> | ||
<div> | ||
<code> | ||
<a name="/s:C11SwiftMonkey6Monkey"></a> | ||
<a name="//apple_ref/swift/Class/Monkey" class="dashAnchor"></a> | ||
<a class="token" href="#/s:C11SwiftMonkey6Monkey">Monkey</a> | ||
</code> | ||
</div> | ||
<div class="height-container"> | ||
<div class="pointer-container"></div> | ||
<section class="section"> | ||
<div class="pointer"></div> | ||
<div class="abstract"> | ||
<p>A general-purpose class for implementing randomised | ||
UI tests. This class lets you schedule blocks to be | ||
run at random or fixed intervals, and provides helper | ||
functions to generate random coordinates.</p> | ||
|
||
<p>It has several extensions that implement actual event | ||
generation, using different methods. For normal usage, | ||
you will want to look at for instance the XCTest private | ||
API based extension.</p> | ||
|
||
<p>If all you want to do is geneate some events and you do | ||
not care about the finer details, you can just use a | ||
test case like the following:</p> | ||
|
||
<pre class="highlight plaintext"><code>func testMonkey() { | ||
let application = XCUIApplication() | ||
|
||
// Workaround for bug in Xcode 7.3. Snapshots are not properly updated | ||
// when you initially call app.frame, resulting in a zero-sized rect. | ||
// Doing a random query seems to update everything properly. | ||
// TODO: Remove this when the Xcode bug is fixed! | ||
_ = application.descendants(matching: .any).element(boundBy: 0).frame | ||
|
||
// Initialise the monkey tester with the current device | ||
// frame. Giving an explicit seed will make it generate | ||
// the same sequence of events on each run, and leaving it | ||
// out will generate a new sequence on each run. | ||
let monkey = Monkey(frame: application.frame) | ||
//let monkey = Monkey(seed: 123, frame: application.frame) | ||
|
||
// Add actions for the monkey to perform. We just use a | ||
// default set of actions for this, which is usually enough. | ||
// Use either one of these but maybe not both. | ||
// XCTest private actions seem to work better at the moment. | ||
// UIAutomation actions seem to work only on the simulator. | ||
monkey.addDefaultXCTestPrivateActions() | ||
//monkey.addDefaultUIAutomationActions() | ||
|
||
// Occasionally, use the regular XCTest functionality | ||
// to check if an alert is shown, and click a random | ||
// button on it. | ||
monkey.addXCTestTapAlertAction(interval: 100, application: application) | ||
|
||
// Run the monkey test indefinitely. | ||
monkey.monkeyAround() | ||
} | ||
</code></pre> | ||
|
||
<a href="Classes/Monkey.html" class="slightly-smaller">See more</a> | ||
</div> | ||
<div class="declaration"> | ||
<h4>Declaration</h4> | ||
<div class="language"> | ||
<p class="aside-title">Swift</p> | ||
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">Monkey</span></code></pre> | ||
|
||
</div> | ||
</div> | ||
</section> | ||
</div> | ||
</li> | ||
</ul> | ||
</div> | ||
</section> | ||
</section> | ||
<section id="footer"> | ||
<p>© 2016 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2016-11-28)</p> | ||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.2</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p> | ||
</section> | ||
</article> | ||
</div> | ||
</body> | ||
</div> | ||
</html> |
Oops, something went wrong.