diff --git a/SwiftMonkey/Documentation/Classes.html b/SwiftMonkey/Documentation/Classes.html index ccda4a3..063cfca 100644 --- a/SwiftMonkey/Documentation/Classes.html +++ b/SwiftMonkey/Documentation/Classes.html @@ -13,12 +13,12 @@
-

Docs (100% documented)

+

SwiftMonkey Docs (100% documented)

@@ -49,9 +49,9 @@

Classes

  • - + - Monkey + Monkey
    @@ -72,7 +72,6 @@

    Classes

    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:

    -
    func testMonkey() {
         let application = XCUIApplication()
     
    @@ -125,8 +124,8 @@ 

    Declaration

    diff --git a/SwiftMonkey/Documentation/Classes/Monkey.html b/SwiftMonkey/Documentation/Classes/Monkey.html index 14e020a..58328c6 100644 --- a/SwiftMonkey/Documentation/Classes/Monkey.html +++ b/SwiftMonkey/Documentation/Classes/Monkey.html @@ -14,12 +14,12 @@
    -

    Docs (100% documented)

    +

    SwiftMonkey Docs (100% documented)

    @@ -60,7 +60,6 @@

    Monkey

    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:

    -
    func testMonkey() {
         let application = XCUIApplication()
     
    @@ -102,9 +101,9 @@ 

    Monkey

  • @@ -119,7 +118,6 @@

    Monkey

    There is an XCTest bug to be aware of when finding the frame to use. Here is an example of how to work around this problem:

    -
    let application = XCUIApplication()
     
     // Workaround for bug in Xcode 7.3 and later. Snapshots are not properly
    @@ -151,8 +149,8 @@ 

    Parameters

    -

    The frame to generate events in. Should be set to the size of the device being tested.

    - +

    The frame to generate events in. +Should be set to the size of the device being tested.

    @@ -165,9 +163,9 @@

    Parameters

  • @@ -185,7 +183,6 @@

    Parameters

    There is an XCTest bug to be aware of when finding the frame to use. Here is an example of how to work around this problem:

    -
    let application = XCUIApplication()
     
     // Workaround for bug in Xcode 7.3 and later. Snapshots are not properly
    @@ -217,8 +214,8 @@ 

    Parameters

    -

    The random seed to use. Each value will generate a different stream of events.

    - +

    The random seed to use. Each value +will generate a different stream of events.

    @@ -230,8 +227,8 @@

    Parameters

    -

    The frame to generate events in. Should be set to the size of the device being tested.

    - +

    The frame to generate events in. +Should be set to the size of the device being tested.

    @@ -244,9 +241,9 @@

    Parameters

  • @@ -256,14 +253,6 @@

    Parameters

    Generate a number of random events.

    -
    -

    Parameter

    - Parameter iterations: The number of random events -to generate. Does not include any fixed interval -events that may also be generated. - -
    -

    Declaration

    @@ -285,8 +274,9 @@

    Parameters

    -

    The number of random events to generate. Does not include any fixed interval events that may also be generated.

    - +

    The number of random events +to generate. Does not include any fixed interval +events that may also be generated.

    @@ -299,9 +289,9 @@

    Parameters

  • @@ -309,26 +299,46 @@

    Parameters

    -

    Generate random events forever, or until the app crashes.

    +

    Generate random events or fixed-interval events based forever, for a specific duration or until the app crashes.

    Declaration

    Swift

    -
    public func monkeyAround()
    +
    public func monkeyAround(forDuration duration: TimeInterval = .infinity)
    +
    +

    Parameters

    + + + + + + + +
    + + duration + + +
    +

    The duration for which to generate the random events. + Set to .infinity by default.

    +
    +
    +
  • @@ -353,9 +363,9 @@

    Declaration

  • @@ -380,9 +390,9 @@

    Declaration

  • @@ -413,8 +423,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -426,8 +438,8 @@

    Parameters

    -

    The block to run when this event is generated.

    - +

    The block to run when this event +is generated.

    @@ -440,9 +452,9 @@

    Parameters

  • @@ -473,8 +485,9 @@

    Parameters

    -

    How often to generate this event. One of these events will be generated after this many randomised events have been generated.

    - +

    How often to generate this +event. One of these events will be generated after +this many randomised events have been generated.

    @@ -486,8 +499,8 @@

    Parameters

    -

    The block to run when this event is generated.

    - +

    The block to run when this event +is generated.

    @@ -500,9 +513,9 @@

    Parameters

  • @@ -533,8 +546,8 @@

    Parameters

    -

    The returned value will be less than this value, and greater than or equal to zero.

    - +

    The returned value will be +less than this value, and greater than or equal to zero.

    @@ -547,9 +560,9 @@

    Parameters

  • @@ -580,8 +593,8 @@

    Parameters

    -

    The returned value will be less than this value, and greater than or equal to zero.

    - +

    The returned value will be +less than this value, and greater than or equal to zero.

    @@ -594,9 +607,9 @@

    Parameters

  • @@ -627,8 +640,8 @@

    Parameters

    -

    The returned value will be less than this value, and greater than or equal to zero.

    - +

    The returned value will be +less than this value, and greater than or equal to zero.

    @@ -641,9 +654,9 @@

    Parameters

  • @@ -668,9 +681,38 @@

    Declaration

  • +
    +
    +
    +
    +
    +

    Generate a random CGPoint inside the frame of the app, +avoiding the areas at the top and bottom of the screen +that trigger a panel pull-out.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func randomPointAvoidingPanelAreas() -> CGPoint
    + +
    +
    +
    +
    +
  • +
  • +
    @@ -702,7 +744,6 @@

    Parameters

    The rect within which to pick the point.

    -
    @@ -715,9 +756,9 @@

    Parameters

  • @@ -742,9 +783,9 @@

    Declaration

  • @@ -776,8 +817,9 @@

    Parameters

    -

    The fraction of the size of the frame to use as the of the area for generated points.

    - +

    The fraction of the size of +the frame to use as the of the area for generated +points.

    @@ -790,9 +832,9 @@

    Parameters

  • @@ -821,9 +863,9 @@

    Declaration

  • @@ -851,9 +893,9 @@

    Declaration

  • @@ -864,15 +906,6 @@

    Declaration

    Add an action that generates a single tap event using the private UIAutomation API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -894,8 +927,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -908,9 +943,9 @@

    Parameters

  • @@ -944,8 +979,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -957,8 +994,8 @@

    Parameters

    -

    Probability that the tap event will tap multiple times. Between 0 and 1.

    - +

    Probability that +the tap event will tap multiple times. Between 0 and 1.

    @@ -970,8 +1007,8 @@

    Parameters

    -

    Probability that the tap event will use multiple fingers. Between 0 and 1.

    - +

    Probability that +the tap event will use multiple fingers. Between 0 and 1.

    @@ -983,8 +1020,8 @@

    Parameters

    -

    Probability that the tap event will be a long press. Between 0 and 1.

    - +

    Probability that +the tap event will be a long press. Between 0 and 1.

    @@ -997,9 +1034,9 @@

    Parameters

  • @@ -1010,15 +1047,6 @@

    Parameters

    Add an action that generates a drag event from one random screen position to another using the private UIAutomation API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -1040,8 +1068,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1054,9 +1084,9 @@

    Parameters

  • @@ -1067,15 +1097,6 @@

    Parameters

    Add an action that generates a flick event from one random screen position to another using the private UIAutomation API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -1097,8 +1118,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1111,9 +1134,9 @@

    Parameters

  • @@ -1124,15 +1147,6 @@

    Parameters

    Add an action that generates a pinch close gesture at a random screen position using the private UIAutomation API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -1154,8 +1168,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1168,9 +1184,9 @@

    Parameters

  • @@ -1181,15 +1197,6 @@

    Parameters

    Add an action that generates a pinch open gesture at a random screen position using the private UIAutomation API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -1211,8 +1218,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1225,9 +1234,9 @@

    Parameters

  • @@ -1239,15 +1248,6 @@

    Parameters

    at a random screen position over a random angle using the private UIAutomation API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -1269,8 +1269,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1283,9 +1285,9 @@

    Parameters

  • @@ -1296,15 +1298,6 @@

    Parameters

    Add an action that generates a device rotation event using the private UIAutomation API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -1326,8 +1319,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1340,9 +1335,9 @@

    Parameters

  • @@ -1353,15 +1348,6 @@

    Parameters

    Add an action that generates a volume up click event using the private UIAutomation API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -1383,8 +1369,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1397,9 +1385,9 @@

    Parameters

  • @@ -1410,15 +1398,6 @@

    Parameters

    Add an action that generates a volume down click event using the private UIAutomation API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -1440,8 +1419,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1454,9 +1435,9 @@

    Parameters

  • @@ -1467,15 +1448,6 @@

    Parameters

    Add an action that generates a shake event using the private UIAutomation API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -1497,8 +1469,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1511,9 +1485,9 @@

    Parameters

  • @@ -1524,15 +1498,6 @@

    Parameters

    Add an action that generates a lock button click event and subsequent unlock drag event using the private UIAutomation API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -1554,8 +1519,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1572,9 +1539,9 @@

    Parameters

  • @@ -1607,8 +1574,9 @@

    Parameters

    -

    How often to generate this event. One of these events will be generated after this many randomised events have been generated.

    - +

    How often to generate this +event. One of these events will be generated after +this many randomised events have been generated.

    @@ -1620,8 +1588,8 @@

    Parameters

    -

    The XCUIApplication object for the current application.

    - +

    The XCUIApplication object +for the current application.

    @@ -1638,9 +1606,9 @@

    Parameters

  • @@ -1668,9 +1636,9 @@

    Declaration

  • @@ -1704,8 +1672,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1717,8 +1687,8 @@

    Parameters

    -

    Probability that the tap event will tap multiple times. Between 0 and 1.

    - +

    Probability that +the tap event will tap multiple times. Between 0 and 1.

    @@ -1730,8 +1700,8 @@

    Parameters

    -

    Probability that the tap event will use multiple fingers. Between 0 and 1.

    - +

    Probability that +the tap event will use multiple fingers. Between 0 and 1.

    @@ -1744,9 +1714,9 @@

    Parameters

  • @@ -1757,15 +1727,6 @@

    Parameters

    Add an action that generates a long press event using the private XCTest API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -1787,8 +1748,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1801,9 +1764,9 @@

    Parameters

  • @@ -1814,15 +1777,6 @@

    Parameters

    Add an action that generates a drag event from one random screen position to another using the private XCTest API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -1844,8 +1798,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1858,9 +1814,9 @@

    Parameters

  • @@ -1871,15 +1827,6 @@

    Parameters

    Add an action that generates a pinch close gesture at a random screen position using the private XCTest API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -1901,8 +1848,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1915,9 +1864,9 @@

    Parameters

  • @@ -1928,15 +1877,6 @@

    Parameters

    Add an action that generates a pinch open gesture at a random screen position using the private XCTest API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -1958,8 +1898,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1972,9 +1914,9 @@

    Parameters

  • @@ -1986,15 +1928,6 @@

    Parameters

    at a random screen position over a random angle using the private XCTest API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -2016,8 +1949,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -2030,9 +1965,9 @@

    Parameters

  • @@ -2043,15 +1978,6 @@

    Parameters

    Add an action that generates a device rotation event using the private XCTest API. Does not currently work!

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -2073,8 +1999,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -2089,8 +2017,8 @@

    Parameters

    diff --git a/SwiftMonkey/Documentation/badge.svg b/SwiftMonkey/Documentation/badge.svg new file mode 100644 index 0000000..2606d80 --- /dev/null +++ b/SwiftMonkey/Documentation/badge.svg @@ -0,0 +1 @@ +documentationdocumentation100%100% \ No newline at end of file diff --git a/SwiftMonkey/Documentation/css/jazzy.css b/SwiftMonkey/Documentation/css/jazzy.css index d6d65b7..d628282 100644 --- a/SwiftMonkey/Documentation/css/jazzy.css +++ b/SwiftMonkey/Documentation/css/jazzy.css @@ -164,6 +164,11 @@ header { padding-top: 10px; } .main-content section .task-group-section .task-group:first-of-type .section-name { padding-top: 15px; } + .main-content section .heading:before { + content: ""; + display: block; + padding-top: 70px; + margin: -70px 0 0; } .section { padding: 0 25px; } diff --git a/SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/Documents/index.html b/SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/Documents/index.html deleted file mode 100644 index bf56fc9..0000000 --- a/SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/Documents/index.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - Reference - - - - - - - - - -
    -
    -

    Docs (100% documented)

    -
    -
    -
    - -
    -
    - -
    -
    -
    - -

    Authors

    - -
    -
    - -
    -
    - -
  • - diff --git a/SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/Documents/undocumented.json b/SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/Documents/undocumented.json deleted file mode 100644 index ca7c5e4..0000000 --- a/SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/Documents/undocumented.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "warnings": [ - - ], - "source_directory": "/Users/dagren/Code/SwiftMonkey/SwiftMonkey" -} \ No newline at end of file diff --git a/SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/docSet.dsidx b/SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/docSet.dsidx deleted file mode 100644 index d61635d..0000000 Binary files a/SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/docSet.dsidx and /dev/null differ diff --git a/SwiftMonkey/Documentation/docsets/.tgz b/SwiftMonkey/Documentation/docsets/.tgz deleted file mode 100644 index 2992b83..0000000 Binary files a/SwiftMonkey/Documentation/docsets/.tgz and /dev/null differ diff --git a/SwiftMonkey/Documentation/docsets/.docset/Contents/Info.plist b/SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Info.plist similarity index 81% rename from SwiftMonkey/Documentation/docsets/.docset/Contents/Info.plist rename to SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Info.plist index 61863ec..71c9b55 100644 --- a/SwiftMonkey/Documentation/docsets/.docset/Contents/Info.plist +++ b/SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Info.plist @@ -3,11 +3,11 @@ CFBundleIdentifier - com.jazzy. + com.jazzy.swiftmonkey CFBundleName - + SwiftMonkey DocSetPlatformFamily - + swiftmonkey isDashDocset dashIndexFilePath diff --git a/SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/Documents/Classes.html b/SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/Documents/Classes.html similarity index 89% rename from SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/Documents/Classes.html rename to SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/Documents/Classes.html index ccda4a3..063cfca 100644 --- a/SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/Documents/Classes.html +++ b/SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/Documents/Classes.html @@ -13,12 +13,12 @@
    -

    Docs (100% documented)

    +

    SwiftMonkey Docs (100% documented)

    @@ -49,9 +49,9 @@

    Classes

  • - + - Monkey + Monkey
    @@ -72,7 +72,6 @@

    Classes

    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:

    -
    func testMonkey() {
         let application = XCUIApplication()
     
    @@ -125,8 +124,8 @@ 

    Declaration

    diff --git a/SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/Documents/Classes/Monkey.html b/SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/Documents/Classes/Monkey.html similarity index 82% rename from SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/Documents/Classes/Monkey.html rename to SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/Documents/Classes/Monkey.html index 14e020a..58328c6 100644 --- a/SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/Documents/Classes/Monkey.html +++ b/SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/Documents/Classes/Monkey.html @@ -14,12 +14,12 @@
    -

    Docs (100% documented)

    +

    SwiftMonkey Docs (100% documented)

    @@ -60,7 +60,6 @@

    Monkey

    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:

    -
    func testMonkey() {
         let application = XCUIApplication()
     
    @@ -102,9 +101,9 @@ 

    Monkey

  • @@ -119,7 +118,6 @@

    Monkey

    There is an XCTest bug to be aware of when finding the frame to use. Here is an example of how to work around this problem:

    -
    let application = XCUIApplication()
     
     // Workaround for bug in Xcode 7.3 and later. Snapshots are not properly
    @@ -151,8 +149,8 @@ 

    Parameters

    -

    The frame to generate events in. Should be set to the size of the device being tested.

    - +

    The frame to generate events in. +Should be set to the size of the device being tested.

    @@ -165,9 +163,9 @@

    Parameters

  • @@ -185,7 +183,6 @@

    Parameters

    There is an XCTest bug to be aware of when finding the frame to use. Here is an example of how to work around this problem:

    -
    let application = XCUIApplication()
     
     // Workaround for bug in Xcode 7.3 and later. Snapshots are not properly
    @@ -217,8 +214,8 @@ 

    Parameters

    -

    The random seed to use. Each value will generate a different stream of events.

    - +

    The random seed to use. Each value +will generate a different stream of events.

    @@ -230,8 +227,8 @@

    Parameters

    -

    The frame to generate events in. Should be set to the size of the device being tested.

    - +

    The frame to generate events in. +Should be set to the size of the device being tested.

    @@ -244,9 +241,9 @@

    Parameters

  • @@ -256,14 +253,6 @@

    Parameters

    Generate a number of random events.

    -
    -

    Parameter

    - Parameter iterations: The number of random events -to generate. Does not include any fixed interval -events that may also be generated. - -
    -

    Declaration

    @@ -285,8 +274,9 @@

    Parameters

    -

    The number of random events to generate. Does not include any fixed interval events that may also be generated.

    - +

    The number of random events +to generate. Does not include any fixed interval +events that may also be generated.

    @@ -299,9 +289,9 @@

    Parameters

  • @@ -309,26 +299,46 @@

    Parameters

    -

    Generate random events forever, or until the app crashes.

    +

    Generate random events or fixed-interval events based forever, for a specific duration or until the app crashes.

    Declaration

    Swift

    -
    public func monkeyAround()
    +
    public func monkeyAround(forDuration duration: TimeInterval = .infinity)
    +
    +

    Parameters

    + + + + + + + +
    + + duration + + +
    +

    The duration for which to generate the random events. + Set to .infinity by default.

    +
    +
    +
  • @@ -353,9 +363,9 @@

    Declaration

  • @@ -380,9 +390,9 @@

    Declaration

  • @@ -413,8 +423,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -426,8 +438,8 @@

    Parameters

    -

    The block to run when this event is generated.

    - +

    The block to run when this event +is generated.

    @@ -440,9 +452,9 @@

    Parameters

  • @@ -473,8 +485,9 @@

    Parameters

    -

    How often to generate this event. One of these events will be generated after this many randomised events have been generated.

    - +

    How often to generate this +event. One of these events will be generated after +this many randomised events have been generated.

    @@ -486,8 +499,8 @@

    Parameters

    -

    The block to run when this event is generated.

    - +

    The block to run when this event +is generated.

    @@ -500,9 +513,9 @@

    Parameters

  • @@ -533,8 +546,8 @@

    Parameters

    -

    The returned value will be less than this value, and greater than or equal to zero.

    - +

    The returned value will be +less than this value, and greater than or equal to zero.

    @@ -547,9 +560,9 @@

    Parameters

  • @@ -580,8 +593,8 @@

    Parameters

    -

    The returned value will be less than this value, and greater than or equal to zero.

    - +

    The returned value will be +less than this value, and greater than or equal to zero.

    @@ -594,9 +607,9 @@

    Parameters

  • @@ -627,8 +640,8 @@

    Parameters

    -

    The returned value will be less than this value, and greater than or equal to zero.

    - +

    The returned value will be +less than this value, and greater than or equal to zero.

    @@ -641,9 +654,9 @@

    Parameters

  • @@ -668,9 +681,38 @@

    Declaration

  • +
    +
    +
    +
    +
    +

    Generate a random CGPoint inside the frame of the app, +avoiding the areas at the top and bottom of the screen +that trigger a panel pull-out.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func randomPointAvoidingPanelAreas() -> CGPoint
    + +
    +
    +
    +
    +
  • +
  • +
    @@ -702,7 +744,6 @@

    Parameters

    The rect within which to pick the point.

    -
    @@ -715,9 +756,9 @@

    Parameters

  • @@ -742,9 +783,9 @@

    Declaration

  • @@ -776,8 +817,9 @@

    Parameters

    -

    The fraction of the size of the frame to use as the of the area for generated points.

    - +

    The fraction of the size of +the frame to use as the of the area for generated +points.

    @@ -790,9 +832,9 @@

    Parameters

  • @@ -821,9 +863,9 @@

    Declaration

  • @@ -851,9 +893,9 @@

    Declaration

  • @@ -864,15 +906,6 @@

    Declaration

    Add an action that generates a single tap event using the private UIAutomation API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -894,8 +927,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -908,9 +943,9 @@

    Parameters

  • @@ -944,8 +979,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -957,8 +994,8 @@

    Parameters

    -

    Probability that the tap event will tap multiple times. Between 0 and 1.

    - +

    Probability that +the tap event will tap multiple times. Between 0 and 1.

    @@ -970,8 +1007,8 @@

    Parameters

    -

    Probability that the tap event will use multiple fingers. Between 0 and 1.

    - +

    Probability that +the tap event will use multiple fingers. Between 0 and 1.

    @@ -983,8 +1020,8 @@

    Parameters

    -

    Probability that the tap event will be a long press. Between 0 and 1.

    - +

    Probability that +the tap event will be a long press. Between 0 and 1.

    @@ -997,9 +1034,9 @@

    Parameters

  • @@ -1010,15 +1047,6 @@

    Parameters

    Add an action that generates a drag event from one random screen position to another using the private UIAutomation API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -1040,8 +1068,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1054,9 +1084,9 @@

    Parameters

  • @@ -1067,15 +1097,6 @@

    Parameters

    Add an action that generates a flick event from one random screen position to another using the private UIAutomation API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -1097,8 +1118,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1111,9 +1134,9 @@

    Parameters

  • @@ -1124,15 +1147,6 @@

    Parameters

    Add an action that generates a pinch close gesture at a random screen position using the private UIAutomation API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -1154,8 +1168,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1168,9 +1184,9 @@

    Parameters

  • @@ -1181,15 +1197,6 @@

    Parameters

    Add an action that generates a pinch open gesture at a random screen position using the private UIAutomation API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -1211,8 +1218,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1225,9 +1234,9 @@

    Parameters

  • @@ -1239,15 +1248,6 @@

    Parameters

    at a random screen position over a random angle using the private UIAutomation API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -1269,8 +1269,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1283,9 +1285,9 @@

    Parameters

  • @@ -1296,15 +1298,6 @@

    Parameters

    Add an action that generates a device rotation event using the private UIAutomation API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -1326,8 +1319,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1340,9 +1335,9 @@

    Parameters

  • @@ -1353,15 +1348,6 @@

    Parameters

    Add an action that generates a volume up click event using the private UIAutomation API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -1383,8 +1369,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1397,9 +1385,9 @@

    Parameters

  • @@ -1410,15 +1398,6 @@

    Parameters

    Add an action that generates a volume down click event using the private UIAutomation API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -1440,8 +1419,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1454,9 +1435,9 @@

    Parameters

  • @@ -1467,15 +1448,6 @@

    Parameters

    Add an action that generates a shake event using the private UIAutomation API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -1497,8 +1469,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1511,9 +1485,9 @@

    Parameters

  • @@ -1524,15 +1498,6 @@

    Parameters

    Add an action that generates a lock button click event and subsequent unlock drag event using the private UIAutomation API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -1554,8 +1519,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1572,9 +1539,9 @@

    Parameters

  • @@ -1607,8 +1574,9 @@

    Parameters

    -

    How often to generate this event. One of these events will be generated after this many randomised events have been generated.

    - +

    How often to generate this +event. One of these events will be generated after +this many randomised events have been generated.

    @@ -1620,8 +1588,8 @@

    Parameters

    -

    The XCUIApplication object for the current application.

    - +

    The XCUIApplication object +for the current application.

    @@ -1638,9 +1606,9 @@

    Parameters

  • @@ -1668,9 +1636,9 @@

    Declaration

  • @@ -1704,8 +1672,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1717,8 +1687,8 @@

    Parameters

    -

    Probability that the tap event will tap multiple times. Between 0 and 1.

    - +

    Probability that +the tap event will tap multiple times. Between 0 and 1.

    @@ -1730,8 +1700,8 @@

    Parameters

    -

    Probability that the tap event will use multiple fingers. Between 0 and 1.

    - +

    Probability that +the tap event will use multiple fingers. Between 0 and 1.

    @@ -1744,9 +1714,9 @@

    Parameters

  • @@ -1757,15 +1727,6 @@

    Parameters

    Add an action that generates a long press event using the private XCTest API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -1787,8 +1748,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1801,9 +1764,9 @@

    Parameters

  • @@ -1814,15 +1777,6 @@

    Parameters

    Add an action that generates a drag event from one random screen position to another using the private XCTest API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -1844,8 +1798,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1858,9 +1814,9 @@

    Parameters

  • @@ -1871,15 +1827,6 @@

    Parameters

    Add an action that generates a pinch close gesture at a random screen position using the private XCTest API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -1901,8 +1848,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1915,9 +1864,9 @@

    Parameters

  • @@ -1928,15 +1877,6 @@

    Parameters

    Add an action that generates a pinch open gesture at a random screen position using the private XCTest API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -1958,8 +1898,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -1972,9 +1914,9 @@

    Parameters

  • @@ -1986,15 +1928,6 @@

    Parameters

    at a random screen position over a random angle using the private XCTest API.

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -2016,8 +1949,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -2030,9 +1965,9 @@

    Parameters

  • @@ -2043,15 +1978,6 @@

    Parameters

    Add an action that generates a device rotation event using the private XCTest API. Does not currently work!

    -
    -

    Parameter

    - Parameter weight: The relative probability of this -event being generated. Can be any value larger than -zero. Probabilities will be normalised to the sum -of all relative probabilities. - -
    -

    Declaration

    @@ -2073,8 +1999,10 @@

    Parameters

    -

    The relative probability of this event being generated. Can be any value larger than zero. Probabilities will be normalised to the sum of all relative probabilities.

    - +

    The relative probability of this +event being generated. Can be any value larger than +zero. Probabilities will be normalised to the sum +of all relative probabilities.

    @@ -2089,8 +2017,8 @@

    Parameters

    diff --git a/SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/Documents/css/highlight.css b/SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/Documents/css/highlight.css similarity index 100% rename from SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/Documents/css/highlight.css rename to SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/Documents/css/highlight.css diff --git a/SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/Documents/css/jazzy.css b/SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/Documents/css/jazzy.css similarity index 98% rename from SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/Documents/css/jazzy.css rename to SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/Documents/css/jazzy.css index d6d65b7..d628282 100644 --- a/SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/Documents/css/jazzy.css +++ b/SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/Documents/css/jazzy.css @@ -164,6 +164,11 @@ header { padding-top: 10px; } .main-content section .task-group-section .task-group:first-of-type .section-name { padding-top: 15px; } + .main-content section .heading:before { + content: ""; + display: block; + padding-top: 70px; + margin: -70px 0 0; } .section { padding: 0 25px; } diff --git a/SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/Documents/img/carat.png b/SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/Documents/img/carat.png similarity index 100% rename from SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/Documents/img/carat.png rename to SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/Documents/img/carat.png diff --git a/SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/Documents/img/dash.png b/SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/Documents/img/dash.png similarity index 100% rename from SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/Documents/img/dash.png rename to SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/Documents/img/dash.png diff --git a/SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/Documents/img/gh.png b/SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/Documents/img/gh.png similarity index 100% rename from SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/Documents/img/gh.png rename to SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/Documents/img/gh.png diff --git a/SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/Documents/index.html b/SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/Documents/index.html new file mode 100644 index 0000000..d2cdddc --- /dev/null +++ b/SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/Documents/index.html @@ -0,0 +1,294 @@ + + + + SwiftMonkey Reference + + + + + + + + + +
    +
    +

    SwiftMonkey Docs (100% documented)

    +
    +
    +
    + +
    +
    + +
    +
    +
    + +

    SwiftMonkey

    + +

    This project is a framework for generating randomised user input +in iOS apps. This kind of monkey testing is useful for +stress-testing apps and finding rare crashes.

    + +

    It also contains a related framework called SwiftMonkeyPaws, which +provides visualisation of the generated events. This greatly +increases the usefulness of your randomised testing, as you can +see what touches caused any crash you may encounter.

    +

    Why Use SwiftMonkey?

    + +
      +
    • When testing your UI, it’s very easy to think about how to test +how things should work, but do you struggle to figure out +what kind of thing might not work?
    • +
    • Ever showed your app to someone who proceeded to bang away at the +screen and immediately crashed it by doing something you had never +thought of?
    • +
    • Do you want to feel a bit more confident about your app’s stability?
    • +
    • Do you have rare crashes that you just can’t reproduce?
    • +
    • Do you have memory leaks that take a long time to manifest +themselves, and require lots of UI actions?
    • +
    + +

    Randomised testing will help you with all of these!

    + +

    SwiftMonkey is inspired by and has similar goals to +UI AutoMonkey, but is integrated into the Xcode UI testing +framework, providing better opportunities to debug.

    + +

    Also, it is fun to look at:

    + +

    +

    Quick Start

    + +

    To see for yourself how this framework works, just grab the code +and open SwiftMonkeyExample/SwiftMonkeyExample.xcodeproj. Then press Cmd-U to run the UI test.

    +

    Installation

    + +

    As a high-level overview, add SwiftMonkey.framework to your +UI test target. Then add a test that creates a Monkey +object and uses it to generate events.

    + +

    Optionally, you also add the SwiftMonkeyPaws.framework to your +main app, and create a MonkeyPaws object to enable visualisation. +You probably only want to do this for debug builds, or when a +specific command line flag is used.

    +

    Requirements

    + +

    SwiftMonkey uses Swift 3.0. It has no dependencies other than +iOS itself (8.0 and up should work). SwiftMonkeyPaws doesn’t +have any dependencies, either; you can even use on its own, +without SwiftMonkey.

    +

    CocoaPods

    + +

    You can install the frameworks using CocoaPods. Assuming +that you’ve named your main app and test targets App and Tests, you +can use something like this in your Podfile:

    +
    target "App" do
    +    pod "SwiftMonkeyPaws", "~> 1.0"
    +end
    +
    +target "Tests" do
    +    pod "SwiftMonkey", "~> 1.0"
    +end
    +
    +

    Manual Installation

    + +

    Copy the SwiftMonkey and SwiftMonkeyPaws folders into your +project. Next, drag the xcodeproj files into your project.

    + +

    Then, for SwiftMonkey, add SwiftMonkey.framework as a +dependency for your test target, and add a Copy Files build +phase to copy it into Frameworks.

    + +

    For SwiftMonkeyPaws, adding SwiftMonkeyPaws.framework to the +Embedded Binaries section of your app target is enough.

    + +

    (You can also just directly link the Swift files, if you do not +want to use frameworks.)

    +

    Swift Package Manager

    + +

    As of this writing, the Swift Package Manager doesn’t support +iOS projects. SPM package files have experimentally been created, +but obviously don’t really work yet.

    +

    Usage

    +

    SwiftMonkey

    + +

    To do monkey testing, import SwiftMonkey, then create a new +test case that uses the Monkey object to configure and run +the input event generation. Here is a simple example:

    +
    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()
    +}
    +
    + +

    The Monkey object allows you not only to add the built-in +event generators, but also any block of your +own to be executed either randomly or at set intervals. In +these blocks you can do whatever you want, including (but not +only) generate more input events.

    + +

    Documentation for this is limited at the moment, so please +refer to Monkey.swift and its extensions for examples of +how to use the more advanced functionality if you need it.

    +

    SwiftMonkeyPaws

    + +

    The simplest way to enable the visualisation in your app is to +first import SwiftMonkeyPaws, then do the following somewhere +early on in your program execution:

    +
    var paws: MonkeyPaws?
    +
    +func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    +    if CommandLine.arguments.contains("--MonkeyPaws") {
    +        paws = MonkeyPaws(view: window!)
    +    }
    +    return true
    +}
    +
    + +

    (This example uses application(_, didFinishLaunchingWithOptions), +but any time after you have a UIWindow will do. It also only +instatiates the visualisation if a certain command line flag +is passed, so that it can be enabled only for test runs.)

    + +

    This call will swizzle some methods in UIApplication to capture +UIEvents. If you would rather not do this, or if you already have +a source of UIEvents, you can pass the following option to init +to disable swizzling:

    +
    paws = MonkeyPaws(view: window!, tapUIApplication: false)
    +
    + +

    Then you can pass in events with the following call:

    +
    paws?.append(event: event) // event is UIEvent
    +
    +

    Contributing

    + +

    Feel free to file issues and send pull requests for this +project! It is very new and not overly organised yet, so be +bold and go ahead. We will sort out the details as we go along.

    + +

    Code style is currently just four-space identation and regular +Apple Swift formatting.

    + +

    Also, we have adopted the Contributor Covenant as the code +of conduct for this project:

    + +

    http://contributor-covenant.org/version/1/4/

    +

    Thanks to

    + +
      +
    • The Zalando Open Source Guild for helping get this project +off the ground.
    • +
    • João Nunes for help with documentation.
    • +
    • Jakub Mucha for bugfixing.
    • +
    +

    TODO

    +

    SwiftMonkey

    + +
      +
    • Write more documentation.
    • +
    • Add more input event actions.
    • +
    • Add randomised testing using public XCTest APIs instead of private ones. + +
        +
      • Find clickable view and click them directly instead of +clicking random locations, to compensate for the slow +event generation.
      • +
    • +
    • Fix swipe actions to avoid pulling out the top and bottom panels. (This +can cause the monkey to escape from your app, which can be problematic!)
    • +
    • Generally, find a quick way to see if the monkey manages to leave the +application.
    • +
    • Find out how to do device rotations using XCTest private API.
    • +
    • Find out why UIAutomation actions do not work on device, but only on the +simulator.
    • +
    • Investigate other methods of generating input events that do not rely +on private APIs.
    • +
    • Once Swift Package Manager has iOS support, update project +to support it properly.
    • +
    +

    SwiftMonkeyPaws

    + +
      +
    • Add more customisability for the visualisation.
    • +
    +

    SwiftMonkeyExample

    + +
      +
    • Add more UI elements, views and controls to make the example +look more interesting.
    • +
    • Maybe add some actual crashes that the monkey testing can find?
    • +
    +

    Contact

    + +

    This software was originally written by Dag Ågren +(dag.agren@zalando.fi) for Zalando SE. This email address serves +as the main contact address for this project.

    + +

    Bug reports and feature requests are more likely to be addressed +if posted as issues here on GitHub.

    +

    License

    + +

    The MIT License (MIT) Copyright © 2016 Zalando SE, https://tech.zalando.com

    + +

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

    + +

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

    + +

    THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    + +
    +
    + +
    +
    + +
  • + diff --git a/SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/Documents/js/jazzy.js b/SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/Documents/js/jazzy.js similarity index 84% rename from SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/Documents/js/jazzy.js rename to SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/Documents/js/jazzy.js index 4ff9455..3965b5f 100755 --- a/SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/Documents/js/jazzy.js +++ b/SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/Documents/js/jazzy.js @@ -38,3 +38,9 @@ $(".token").click(function(event) { } event.preventDefault(); }); + +// Dumb down quotes within code blocks that delimit strings instead of quotations +// https://github.com/realm/jazzy/issues/714 +$("code q").replaceWith(function () { + return ["\"", $(this).contents(), "\""]; +}); diff --git a/SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/Documents/js/jquery.min.js b/SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/Documents/js/jquery.min.js similarity index 100% rename from SwiftMonkey/Documentation/docsets/.docset/Contents/Resources/Documents/js/jquery.min.js rename to SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/Documents/js/jquery.min.js diff --git a/SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/Documents/search.json b/SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/Documents/search.json new file mode 100644 index 0000000..4326e3a --- /dev/null +++ b/SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/Documents/search.json @@ -0,0 +1 @@ +{"Classes/Monkey.html#/s:11SwiftMonkey0B0CACSC6CGRectV5frame_tcfc":{"name":"init(frame:)","abstract":"

    Create a Monkey object with a randomised seed.","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0CACs6UInt32V4seed_SC6CGRectV5frametcfc":{"name":"init(seed:frame:)","abstract":"

    Create a Monkey object with a fixed seed.","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C12monkeyAroundySi10iterations_tF":{"name":"monkeyAround(iterations:)","abstract":"

    Generate a number of random events.

    ","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C12monkeyAroundySd11forDuration_tF":{"name":"monkeyAround(forDuration:)","abstract":"

    Generate random events or fixed-interval events based forever, for a specific duration or until the app crashes.

    ","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C11actRandomlyyyF":{"name":"actRandomly()","abstract":"

    Generate one random event.

    ","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C12actRegularlyyyF":{"name":"actRegularly()","abstract":"

    Generate any pending fixed-interval events.

    ","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C9addActionySd6weight_yyc6actiontF":{"name":"addAction(weight:action:)","abstract":"

    Add a block for generating randomised events.

    ","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C9addActionySi8interval_yyc6actiontF":{"name":"addAction(interval:action:)","abstract":"

    Add a block for fixed-interval events.

    ","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C9randomIntS2i8lessThan_tF":{"name":"randomInt(lessThan:)","abstract":"

    Generate a random Int.

    ","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C10randomUIntS2u8lessThan_tF":{"name":"randomUInt(lessThan:)","abstract":"

    Generate a random UInt.

    ","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C13randomCGFloat12CoreGraphics0D0VAG8lessThan_tF":{"name":"randomCGFloat(lessThan:)","abstract":"

    Generate a random CGFloat.

    ","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C11randomPointSC7CGPointVyF":{"name":"randomPoint()","abstract":"

    Generate a random CGPoint inside the frame of the app.

    ","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C29randomPointAvoidingPanelAreasSC7CGPointVyF":{"name":"randomPointAvoidingPanelAreas()","abstract":"

    Generate a random CGPoint inside the frame of the app,","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C11randomPointSC7CGPointVSC6CGRectV6inRect_tF":{"name":"randomPoint(inRect:)","abstract":"

    Generate a random CGPoint inside the given CGRect.

    ","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C10randomRectSC6CGRectVyF":{"name":"randomRect()","abstract":"

    Generate a random CGRect inside the frame of the app.

    ","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C10randomRectSC6CGRectV12CoreGraphics7CGFloatV12sizeFraction_tF":{"name":"randomRect(sizeFraction:)","abstract":"

    Generate a random CGRect inside the frame of the app,","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C21randomClusteredPointsSaySC7CGPointVGSi5count_tF":{"name":"randomClusteredPoints(count:)","abstract":"

    Generate an array of random CGPoints in a loose cluster.

    ","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C29addDefaultUIAutomationActionsyyF":{"name":"addDefaultUIAutomationActions()","abstract":"

    Add a sane default set of event generation actions","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C30addUIAutomationSingleTapActionySd6weight_tF":{"name":"addUIAutomationSingleTapAction(weight:)","abstract":"

    Add an action that generates a single tap event","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C24addUIAutomationTapActionySd6weight_Sd08multipleE11ProbabilitySd0h5TouchI0Sd09longPressI0tF":{"name":"addUIAutomationTapAction(weight:multipleTapProbability:multipleTouchProbability:longPressProbability:)","abstract":"

    Add an action that generates a tap, with a possibility for","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C25addUIAutomationDragActionySd6weight_tF":{"name":"addUIAutomationDragAction(weight:)","abstract":"

    Add an action that generates a drag event from one random","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C26addUIAutomationFlickActionySd6weight_tF":{"name":"addUIAutomationFlickAction(weight:)","abstract":"

    Add an action that generates a flick event from one random","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C31addUIAutomationPinchCloseActionySd6weight_tF":{"name":"addUIAutomationPinchCloseAction(weight:)","abstract":"

    Add an action that generates a pinch close gesture","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C30addUIAutomationPinchOpenActionySd6weight_tF":{"name":"addUIAutomationPinchOpenAction(weight:)","abstract":"

    Add an action that generates a pinch open gesture","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C27addUIAutomationRotateActionySd6weight_tF":{"name":"addUIAutomationRotateAction(weight:)","abstract":"

    Add an action that generates a rotation gesture","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C32addUIAutomationOrientationActionySd6weight_tF":{"name":"addUIAutomationOrientationAction(weight:)","abstract":"

    Add an action that generates a device rotation event","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C34addUIAutomationClickVolumeUpActionySd6weight_tF":{"name":"addUIAutomationClickVolumeUpAction(weight:)","abstract":"

    Add an action that generates a volume up click event","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C36addUIAutomationClickVolumeDownActionySd6weight_tF":{"name":"addUIAutomationClickVolumeDownAction(weight:)","abstract":"

    Add an action that generates a volume down click event","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C26addUIAutomationShakeActionySd6weight_tF":{"name":"addUIAutomationShakeAction(weight:)","abstract":"

    Add an action that generates a shake event","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C25addUIAutomationLockActionySd6weight_tF":{"name":"addUIAutomationLockAction(weight:)","abstract":"

    Add an action that generates a lock button click event and","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C23addXCTestTapAlertActionySi8interval_So15XCUIApplicationC11applicationtF":{"name":"addXCTestTapAlertAction(interval:application:)","abstract":"

    Add an action that checks, at a fixed interval,","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C30addDefaultXCTestPrivateActionsyyF":{"name":"addDefaultXCTestPrivateActions()","abstract":"

    Add a sane default set of event generation actions","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C18addXCTestTapActionySd6weight_Sd08multipleE11ProbabilitySd0h5TouchI0tF":{"name":"addXCTestTapAction(weight:multipleTapProbability:multipleTouchProbability:)","abstract":"

    Add an action that generates a tap, with a possibility for","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C24addXCTestLongPressActionySd6weight_tF":{"name":"addXCTestLongPressAction(weight:)","abstract":"

    Add an action that generates a long press event","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C19addXCTestDragActionySd6weight_tF":{"name":"addXCTestDragAction(weight:)","abstract":"

    Add an action that generates a drag event from one random","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C25addXCTestPinchCloseActionySd6weight_tF":{"name":"addXCTestPinchCloseAction(weight:)","abstract":"

    Add an action that generates a pinch close gesture","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C24addXCTestPinchOpenActionySd6weight_tF":{"name":"addXCTestPinchOpenAction(weight:)","abstract":"

    Add an action that generates a pinch open gesture","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C21addXCTestRotateActionySd6weight_tF":{"name":"addXCTestRotateAction(weight:)","abstract":"

    Add an action that generates a rotation gesture","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C26addXCTestOrientationActionySd6weight_tF":{"name":"addXCTestOrientationAction(weight:)","abstract":"

    Add an action that generates a device rotation event","parent_name":"Monkey"},"Classes/Monkey.html":{"name":"Monkey","abstract":"

    A general-purpose class for implementing randomised"},"Classes.html":{"name":"Classes","abstract":"

    The following classes are available globally.

    "}} \ No newline at end of file diff --git a/SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/docSet.dsidx b/SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/docSet.dsidx new file mode 100644 index 0000000..c4bc7a7 Binary files /dev/null and b/SwiftMonkey/Documentation/docsets/SwiftMonkey.docset/Contents/Resources/docSet.dsidx differ diff --git a/SwiftMonkey/Documentation/docsets/SwiftMonkey.tgz b/SwiftMonkey/Documentation/docsets/SwiftMonkey.tgz new file mode 100644 index 0000000..8cf68c4 Binary files /dev/null and b/SwiftMonkey/Documentation/docsets/SwiftMonkey.tgz differ diff --git a/SwiftMonkey/Documentation/index.html b/SwiftMonkey/Documentation/index.html index bf56fc9..d2cdddc 100644 --- a/SwiftMonkey/Documentation/index.html +++ b/SwiftMonkey/Documentation/index.html @@ -1,7 +1,7 @@ - Reference + SwiftMonkey Reference @@ -10,17 +10,17 @@ - +
    -

    Docs (100% documented)

    +

    SwiftMonkey Docs (100% documented)

    @@ -40,13 +40,252 @@
    -

    Authors

    +

    SwiftMonkey

    + +

    This project is a framework for generating randomised user input +in iOS apps. This kind of monkey testing is useful for +stress-testing apps and finding rare crashes.

    + +

    It also contains a related framework called SwiftMonkeyPaws, which +provides visualisation of the generated events. This greatly +increases the usefulness of your randomised testing, as you can +see what touches caused any crash you may encounter.

    +

    Why Use SwiftMonkey?

    + +
      +
    • When testing your UI, it’s very easy to think about how to test +how things should work, but do you struggle to figure out +what kind of thing might not work?
    • +
    • Ever showed your app to someone who proceeded to bang away at the +screen and immediately crashed it by doing something you had never +thought of?
    • +
    • Do you want to feel a bit more confident about your app’s stability?
    • +
    • Do you have rare crashes that you just can’t reproduce?
    • +
    • Do you have memory leaks that take a long time to manifest +themselves, and require lots of UI actions?
    • +
    + +

    Randomised testing will help you with all of these!

    + +

    SwiftMonkey is inspired by and has similar goals to +UI AutoMonkey, but is integrated into the Xcode UI testing +framework, providing better opportunities to debug.

    + +

    Also, it is fun to look at:

    + +

    +

    Quick Start

    + +

    To see for yourself how this framework works, just grab the code +and open SwiftMonkeyExample/SwiftMonkeyExample.xcodeproj. Then press Cmd-U to run the UI test.

    +

    Installation

    + +

    As a high-level overview, add SwiftMonkey.framework to your +UI test target. Then add a test that creates a Monkey +object and uses it to generate events.

    + +

    Optionally, you also add the SwiftMonkeyPaws.framework to your +main app, and create a MonkeyPaws object to enable visualisation. +You probably only want to do this for debug builds, or when a +specific command line flag is used.

    +

    Requirements

    + +

    SwiftMonkey uses Swift 3.0. It has no dependencies other than +iOS itself (8.0 and up should work). SwiftMonkeyPaws doesn’t +have any dependencies, either; you can even use on its own, +without SwiftMonkey.

    +

    CocoaPods

    + +

    You can install the frameworks using CocoaPods. Assuming +that you’ve named your main app and test targets App and Tests, you +can use something like this in your Podfile:

    +
    target "App" do
    +    pod "SwiftMonkeyPaws", "~> 1.0"
    +end
    +
    +target "Tests" do
    +    pod "SwiftMonkey", "~> 1.0"
    +end
    +
    +

    Manual Installation

    + +

    Copy the SwiftMonkey and SwiftMonkeyPaws folders into your +project. Next, drag the xcodeproj files into your project.

    + +

    Then, for SwiftMonkey, add SwiftMonkey.framework as a +dependency for your test target, and add a Copy Files build +phase to copy it into Frameworks.

    + +

    For SwiftMonkeyPaws, adding SwiftMonkeyPaws.framework to the +Embedded Binaries section of your app target is enough.

    + +

    (You can also just directly link the Swift files, if you do not +want to use frameworks.)

    +

    Swift Package Manager

    + +

    As of this writing, the Swift Package Manager doesn’t support +iOS projects. SPM package files have experimentally been created, +but obviously don’t really work yet.

    +

    Usage

    +

    SwiftMonkey

    + +

    To do monkey testing, import SwiftMonkey, then create a new +test case that uses the Monkey object to configure and run +the input event generation. Here is a simple example:

    +
    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()
    +}
    +
    + +

    The Monkey object allows you not only to add the built-in +event generators, but also any block of your +own to be executed either randomly or at set intervals. In +these blocks you can do whatever you want, including (but not +only) generate more input events.

    + +

    Documentation for this is limited at the moment, so please +refer to Monkey.swift and its extensions for examples of +how to use the more advanced functionality if you need it.

    +

    SwiftMonkeyPaws

    + +

    The simplest way to enable the visualisation in your app is to +first import SwiftMonkeyPaws, then do the following somewhere +early on in your program execution:

    +
    var paws: MonkeyPaws?
    +
    +func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    +    if CommandLine.arguments.contains("--MonkeyPaws") {
    +        paws = MonkeyPaws(view: window!)
    +    }
    +    return true
    +}
    +
    + +

    (This example uses application(_, didFinishLaunchingWithOptions), +but any time after you have a UIWindow will do. It also only +instatiates the visualisation if a certain command line flag +is passed, so that it can be enabled only for test runs.)

    + +

    This call will swizzle some methods in UIApplication to capture +UIEvents. If you would rather not do this, or if you already have +a source of UIEvents, you can pass the following option to init +to disable swizzling:

    +
    paws = MonkeyPaws(view: window!, tapUIApplication: false)
    +
    + +

    Then you can pass in events with the following call:

    +
    paws?.append(event: event) // event is UIEvent
    +
    +

    Contributing

    + +

    Feel free to file issues and send pull requests for this +project! It is very new and not overly organised yet, so be +bold and go ahead. We will sort out the details as we go along.

    + +

    Code style is currently just four-space identation and regular +Apple Swift formatting.

    + +

    Also, we have adopted the Contributor Covenant as the code +of conduct for this project:

    + +

    http://contributor-covenant.org/version/1/4/

    +

    Thanks to

    + +
      +
    • The Zalando Open Source Guild for helping get this project +off the ground.
    • +
    • João Nunes for help with documentation.
    • +
    • Jakub Mucha for bugfixing.
    • +
    +

    TODO

    +

    SwiftMonkey

    + +
      +
    • Write more documentation.
    • +
    • Add more input event actions.
    • +
    • Add randomised testing using public XCTest APIs instead of private ones. + +
        +
      • Find clickable view and click them directly instead of +clicking random locations, to compensate for the slow +event generation.
      • +
    • +
    • Fix swipe actions to avoid pulling out the top and bottom panels. (This +can cause the monkey to escape from your app, which can be problematic!)
    • +
    • Generally, find a quick way to see if the monkey manages to leave the +application.
    • +
    • Find out how to do device rotations using XCTest private API.
    • +
    • Find out why UIAutomation actions do not work on device, but only on the +simulator.
    • +
    • Investigate other methods of generating input events that do not rely +on private APIs.
    • +
    • Once Swift Package Manager has iOS support, update project +to support it properly.
    • +
    +

    SwiftMonkeyPaws

    + +
      +
    • Add more customisability for the visualisation.
    • +
    +

    SwiftMonkeyExample

    + +
      +
    • Add more UI elements, views and controls to make the example +look more interesting.
    • +
    • Maybe add some actual crashes that the monkey testing can find?
    • +
    +

    Contact

    + +

    This software was originally written by Dag Ågren +(dag.agren@zalando.fi) for Zalando SE. This email address serves +as the main contact address for this project.

    + +

    Bug reports and feature requests are more likely to be addressed +if posted as issues here on GitHub.

    +

    License

    + +

    The MIT License (MIT) Copyright © 2016 Zalando SE, https://tech.zalando.com

    + +

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

    + +

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

    + +

    THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    diff --git a/SwiftMonkey/Documentation/js/jazzy.js b/SwiftMonkey/Documentation/js/jazzy.js index 4ff9455..3965b5f 100755 --- a/SwiftMonkey/Documentation/js/jazzy.js +++ b/SwiftMonkey/Documentation/js/jazzy.js @@ -38,3 +38,9 @@ $(".token").click(function(event) { } event.preventDefault(); }); + +// Dumb down quotes within code blocks that delimit strings instead of quotations +// https://github.com/realm/jazzy/issues/714 +$("code q").replaceWith(function () { + return ["\"", $(this).contents(), "\""]; +}); diff --git a/SwiftMonkey/Documentation/search.json b/SwiftMonkey/Documentation/search.json new file mode 100644 index 0000000..4326e3a --- /dev/null +++ b/SwiftMonkey/Documentation/search.json @@ -0,0 +1 @@ +{"Classes/Monkey.html#/s:11SwiftMonkey0B0CACSC6CGRectV5frame_tcfc":{"name":"init(frame:)","abstract":"

    Create a Monkey object with a randomised seed.","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0CACs6UInt32V4seed_SC6CGRectV5frametcfc":{"name":"init(seed:frame:)","abstract":"

    Create a Monkey object with a fixed seed.","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C12monkeyAroundySi10iterations_tF":{"name":"monkeyAround(iterations:)","abstract":"

    Generate a number of random events.

    ","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C12monkeyAroundySd11forDuration_tF":{"name":"monkeyAround(forDuration:)","abstract":"

    Generate random events or fixed-interval events based forever, for a specific duration or until the app crashes.

    ","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C11actRandomlyyyF":{"name":"actRandomly()","abstract":"

    Generate one random event.

    ","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C12actRegularlyyyF":{"name":"actRegularly()","abstract":"

    Generate any pending fixed-interval events.

    ","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C9addActionySd6weight_yyc6actiontF":{"name":"addAction(weight:action:)","abstract":"

    Add a block for generating randomised events.

    ","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C9addActionySi8interval_yyc6actiontF":{"name":"addAction(interval:action:)","abstract":"

    Add a block for fixed-interval events.

    ","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C9randomIntS2i8lessThan_tF":{"name":"randomInt(lessThan:)","abstract":"

    Generate a random Int.

    ","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C10randomUIntS2u8lessThan_tF":{"name":"randomUInt(lessThan:)","abstract":"

    Generate a random UInt.

    ","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C13randomCGFloat12CoreGraphics0D0VAG8lessThan_tF":{"name":"randomCGFloat(lessThan:)","abstract":"

    Generate a random CGFloat.

    ","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C11randomPointSC7CGPointVyF":{"name":"randomPoint()","abstract":"

    Generate a random CGPoint inside the frame of the app.

    ","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C29randomPointAvoidingPanelAreasSC7CGPointVyF":{"name":"randomPointAvoidingPanelAreas()","abstract":"

    Generate a random CGPoint inside the frame of the app,","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C11randomPointSC7CGPointVSC6CGRectV6inRect_tF":{"name":"randomPoint(inRect:)","abstract":"

    Generate a random CGPoint inside the given CGRect.

    ","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C10randomRectSC6CGRectVyF":{"name":"randomRect()","abstract":"

    Generate a random CGRect inside the frame of the app.

    ","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C10randomRectSC6CGRectV12CoreGraphics7CGFloatV12sizeFraction_tF":{"name":"randomRect(sizeFraction:)","abstract":"

    Generate a random CGRect inside the frame of the app,","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C21randomClusteredPointsSaySC7CGPointVGSi5count_tF":{"name":"randomClusteredPoints(count:)","abstract":"

    Generate an array of random CGPoints in a loose cluster.

    ","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C29addDefaultUIAutomationActionsyyF":{"name":"addDefaultUIAutomationActions()","abstract":"

    Add a sane default set of event generation actions","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C30addUIAutomationSingleTapActionySd6weight_tF":{"name":"addUIAutomationSingleTapAction(weight:)","abstract":"

    Add an action that generates a single tap event","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C24addUIAutomationTapActionySd6weight_Sd08multipleE11ProbabilitySd0h5TouchI0Sd09longPressI0tF":{"name":"addUIAutomationTapAction(weight:multipleTapProbability:multipleTouchProbability:longPressProbability:)","abstract":"

    Add an action that generates a tap, with a possibility for","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C25addUIAutomationDragActionySd6weight_tF":{"name":"addUIAutomationDragAction(weight:)","abstract":"

    Add an action that generates a drag event from one random","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C26addUIAutomationFlickActionySd6weight_tF":{"name":"addUIAutomationFlickAction(weight:)","abstract":"

    Add an action that generates a flick event from one random","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C31addUIAutomationPinchCloseActionySd6weight_tF":{"name":"addUIAutomationPinchCloseAction(weight:)","abstract":"

    Add an action that generates a pinch close gesture","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C30addUIAutomationPinchOpenActionySd6weight_tF":{"name":"addUIAutomationPinchOpenAction(weight:)","abstract":"

    Add an action that generates a pinch open gesture","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C27addUIAutomationRotateActionySd6weight_tF":{"name":"addUIAutomationRotateAction(weight:)","abstract":"

    Add an action that generates a rotation gesture","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C32addUIAutomationOrientationActionySd6weight_tF":{"name":"addUIAutomationOrientationAction(weight:)","abstract":"

    Add an action that generates a device rotation event","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C34addUIAutomationClickVolumeUpActionySd6weight_tF":{"name":"addUIAutomationClickVolumeUpAction(weight:)","abstract":"

    Add an action that generates a volume up click event","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C36addUIAutomationClickVolumeDownActionySd6weight_tF":{"name":"addUIAutomationClickVolumeDownAction(weight:)","abstract":"

    Add an action that generates a volume down click event","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C26addUIAutomationShakeActionySd6weight_tF":{"name":"addUIAutomationShakeAction(weight:)","abstract":"

    Add an action that generates a shake event","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C25addUIAutomationLockActionySd6weight_tF":{"name":"addUIAutomationLockAction(weight:)","abstract":"

    Add an action that generates a lock button click event and","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C23addXCTestTapAlertActionySi8interval_So15XCUIApplicationC11applicationtF":{"name":"addXCTestTapAlertAction(interval:application:)","abstract":"

    Add an action that checks, at a fixed interval,","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C30addDefaultXCTestPrivateActionsyyF":{"name":"addDefaultXCTestPrivateActions()","abstract":"

    Add a sane default set of event generation actions","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C18addXCTestTapActionySd6weight_Sd08multipleE11ProbabilitySd0h5TouchI0tF":{"name":"addXCTestTapAction(weight:multipleTapProbability:multipleTouchProbability:)","abstract":"

    Add an action that generates a tap, with a possibility for","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C24addXCTestLongPressActionySd6weight_tF":{"name":"addXCTestLongPressAction(weight:)","abstract":"

    Add an action that generates a long press event","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C19addXCTestDragActionySd6weight_tF":{"name":"addXCTestDragAction(weight:)","abstract":"

    Add an action that generates a drag event from one random","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C25addXCTestPinchCloseActionySd6weight_tF":{"name":"addXCTestPinchCloseAction(weight:)","abstract":"

    Add an action that generates a pinch close gesture","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C24addXCTestPinchOpenActionySd6weight_tF":{"name":"addXCTestPinchOpenAction(weight:)","abstract":"

    Add an action that generates a pinch open gesture","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C21addXCTestRotateActionySd6weight_tF":{"name":"addXCTestRotateAction(weight:)","abstract":"

    Add an action that generates a rotation gesture","parent_name":"Monkey"},"Classes/Monkey.html#/s:11SwiftMonkey0B0C26addXCTestOrientationActionySd6weight_tF":{"name":"addXCTestOrientationAction(weight:)","abstract":"

    Add an action that generates a device rotation event","parent_name":"Monkey"},"Classes/Monkey.html":{"name":"Monkey","abstract":"

    A general-purpose class for implementing randomised"},"Classes.html":{"name":"Classes","abstract":"

    The following classes are available globally.

    "}} \ No newline at end of file diff --git a/SwiftMonkey/Documentation/undocumented.json b/SwiftMonkey/Documentation/undocumented.json index ca7c5e4..15a8263 100644 --- a/SwiftMonkey/Documentation/undocumented.json +++ b/SwiftMonkey/Documentation/undocumented.json @@ -2,5 +2,5 @@ "warnings": [ ], - "source_directory": "/Users/dagren/Code/SwiftMonkey/SwiftMonkey" + "source_directory": "/Users/wojciech/Documents/Projekt/Zalando/SwiftMonkey" } \ No newline at end of file