Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Applitools Integration guides #244

Closed
tungmhoang opened this issue Jun 25, 2024 · 1 comment · Fixed by #245
Closed

Add Applitools Integration guides #244

tungmhoang opened this issue Jun 25, 2024 · 1 comment · Fixed by #245
Assignees
Labels
documentation: create Documentation doesn't exist yet

Comments

@tungmhoang
Copy link
Collaborator

tungmhoang commented Jun 25, 2024

Tasks:

  • Checkout a new branch

  • Migrate these 2 docs to a new section under Integration called Applitools Eyes. Make sure to add the necessary navigation in the nav.adoc files.

KOBITON-Enable Applitools Eyes integration-250624-090642.pdf
KOBITON-Run Appium script with Applitools Eyes SDK-250624-090916.pdf
Note: In the pdf the code snippet may be cut off, see below for the full code snippets:

// Set desired capabilities.
DesiredCapabilities capabilities = new DesiredCapabilities();

  capabilities.setCapability("platformName", "Android");
  // Use either deviceName or udid to select the device
  // capabilities.setCapability("deviceName", "Pixel 7");
  capabilities.setCapability("udid", "f40d06b2-daa4-4b62-896e-c0e675135ecd ");
  capabilities.setCapability("platformVersion", "*");
  capabilities.setCapability("app", "https://applitoolsnmlresources.z19.web.core.windows.net/TestApps/app-debug.apk");
  capabilities.setCapability("browserName", "");
  capabilities.setCapability("automationName", "UiAutomator2");
  // Use the kobiton:runtime capability below if you want to launch a Basic Appium 2 session
  // capabilities.setCapability("kobiton:runtime", "appium");
// Open the app.
WebDriver driver = new AndroidDriver(new URL("https://[username]:[api_key]@api.kobiton.com/wd/hub"), capabilities);
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import io.appium.java_client.android.AndroidDriver;
import java.net.URL;
import com.applitools.eyes.appium.Eyes;



public class Appium_native_java {

    public static void main(String[] args) throws Exception {

        // Set desired capabilities.
        DesiredCapabilities capabilities = new DesiredCapabilities();

          capabilities.setCapability("platformName", "Android");
          // Use either deviceName or udid to select the device
          // capabilities.setCapability("deviceName", "Pixel 7");
          capabilities.setCapability("udid", "f40d06b2-daa4-4b62-896e-c0e675135ecd ");
          capabilities.setCapability("platformVersion", "*");
          capabilities.setCapability("app", "https://applitoolsnmlresources.z19.web.core.windows.net/TestApps/app-debug.apk");
          capabilities.setCapability("browserName", "");
          capabilities.setCapability("automationName", "UiAutomator2");
          // Use the kobiton:runtime capability below if you want to launch a Basic Appium 2 session
          // capabilities.setCapability("kobiton:runtime", "appium");

        // Open the app.
        WebDriver driver = new AndroidDriver(new URL("https://johndoe:6aba1969-720f-5453-9234-a65435823638@api.kobiton.com/wd/hub"), capabilities);

        // Initialize the eyes SDK and set your private API key.
        Eyes eyes = new Eyes();
        eyes.setApiKey("ak9FuNVsyEsDi62buhydjLi7HASD5435fgdgdorEHXY110");

        eyes.setForceFullPageScreenshot(true);

        try {

            // Start the test.
            eyes.open(driver, "Contacts!", "My first Appium native Java test!");

            // Visual validation.
            eyes.checkWindow("Contact list!");

            // End the test.
            eyes.close();

        } finally {

            // Close the app.
            driver.quit();

            // If the test was aborted before eyes.close was called, ends the test as aborted.
            eyes.abortIfNotClosed();

        }

    }

}
  • Review the style of the docs to make sure it is consistent with the style of our docs site.
  • Run the docs through Grammarly or ChatGPT to correct grammar mistakes and typos.
  • Make sure images are under 100KB in size.
@tungmhoang tungmhoang added the documentation: create Documentation doesn't exist yet label Jun 25, 2024
@Hikkigaya Hikkigaya linked a pull request Jun 25, 2024 that will close this issue
4 tasks
@Hikkigaya
Copy link
Collaborator

@tungmhoang Task completed. PR created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation: create Documentation doesn't exist yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants