Exemple #1
0
def test_eyes_runner(driver, runner):
    eyes = Eyes(runner)
    eyes2 = Eyes(runner)
    eyes.server_url = "https://eyes.applitools.com/"

    eyes.send_dom = True
    eyes2.send_dom = False
    eyes.stitch_mode = StitchMode.CSS
    eyes2.stitch_mode = StitchMode.CSS

    batch_info = BatchInfo("Runner Testing")
    batch_info.id = "RCA_Batch_ID"
    eyes.batch_info = batch_info
    eyes2.batch_info = batch_info

    driver.get(
        "http://applitools.github.io/demo/TestPages/VisualGridTestPage/index.html"
    )

    eyes.open(
        driver,
        "Applitools Eyes Java SDK",
        "Classic Runner Test",
        dict(width=1200, height=800),
    )
    eyes2.open(
        driver,
        "Applitools Eyes Java SDK",
        "Classic Runner 2 Test",
        dict(width=1200, height=800),
    )

    eyes.check("Step 1", Target.window().fully().ignore_displacements(False))
    eyes2.check("Step 1", Target.window().fully().ignore_displacements(False))

    eyes.close_async()

    eyes.open(
        driver,
        "Applitools Eyes Java SDK",
        "Classic Runner Test",
        dict(width=1200, height=800),
    )
    eyes.check("Step 2", Target.window().fully().ignore_displacements(False))
    eyes.close_async()
    eyes2.close(True)

    driver.quit()
    all_tests_results = runner.get_all_test_results()
    if len(all_tests_results.all_results) != 3:
        raise Exception
Exemple #2
0
    def create_eyes_batch(self, name=None, started_at=None, batch_id=None):
        """
        Returns a BatchInfo object that may be used as batch argument on `Open Eyes Session`. For more information, read `Group tests into batches`.

            | =Arguments=                  | =Description=                                                                              |
            | Name (str)                   | The name of the batch                                                                      |
            | Started At (str or datetime) | The date and time that will be displayed in the Test Manager as the batch start time *(*)* |
            | Batch ID (str)               | This argument groups together tests ran in different executions                            |

        The *Started At* argument may be passed as:
        - String: YYYY-mm-dd HH:MM:SS
        - Datetime variable: See [https://robotframework.org/robotframework/latest/libraries/DateTime.html|DateTime library]

        *(*)* Currently, due to a problem with Eyes, the Test Manager always shows the default batch start time, even when setting a custom one.

        *Example:*
            | ${batch}= | Create Eyes Batch |      
        """

        if started_at is not None:
            if type(started_at) is six.text_type:
                started_at = str(started_at)

            if isinstance(started_at, str):
                started_at = datetime.strptime(started_at, "%Y-%m-%d %H:%M:%S")
        print("###createbatch ###")
        print(name)
        print(started_at)
        print("###createbatch ###")
        if name is not None and started_at is not None:
            batch = BatchInfo(name, started_at)
        elif name is not None:
            batch = BatchInfo(name)
        elif started_at is not None:
            batch = BatchInfo(None, started_at)
        else:
            batch = BatchInfo()

        if batch_id is not None:
            batch.id = batch_id
        return batch
Exemple #3
0
 def set_batch(self, batch_id):
     batch_info = BatchInfo()
     batch_info.name = self.test_name
     batch_info.id = batch_id
     self.eyes.batch = batch_info
def batch_info():
    batch_info = BatchInfo("hello world batch")
    batch_info.id = "hw_VG_Batch_ID"
    return batch_info