コード例 #1
0
    def non_hd_filter_export(self):
        helper_methods = Helper_Methods(self.driver)
        gridPage = GridPage(self.driver)
        settingsPage = SettingsPage(self.driver)
        editorPage = EditorPage(self.driver)

        helper_methods.addAllFiltersFromManager()
        # taps on the settings icon
        gridPage.tapSettingsIcon()
        # taps the hd switch
        settingsPage.HDExportButtonTap()
        self.driver.back()

        for x in filter_list:

            helper_methods.setupFilter()
            # taps on the filter
            print("(" '%s' ")" % x)
            for i in range(0, 50):
                try:
                    WebDriverWait(self.driver, 30).until(
                        EC.presence_of_element_located(
                            (By.ID, ("com.jsdev.instasize:id/ibExport"))))
                    filter = self.driver.find_element_by_xpath("("
                                                               "%s"
                                                               ")" % x)
                    filter.click()
                    editorPage.purchase_premium_banner()
                    break
                except NoSuchElementException:
                    sleep(2)
                    editorPage.swipeInEditor()
                    pass

            helper_methods.filterExportInstagram()
コード例 #2
0
    def test_social_media_icons(self):
        gridPage = GridPage(self.driver)
        settings_page = SettingsPage(self.driver)
        settings_page_asserts = SettingsPageAsserts(self.driver)

        gridPage.tapSettingsIcon()
        settings_page.settings_premium_purchase()
        settings_page.tap_instagram_icon()
        settings_page_asserts.instagram_layout_assert()
        sleep(5)
        self.driver.back()

        settings_page.tap_facebook_icon()
        sleep(5)
        self.driver.back()

        settings_page.tap_twitter_icon()
        settings_page_asserts.twitter_app_assert()
        sleep(5)
        self.driver.back()

        settings_page.tap_youtube_icon()
        settings_page_asserts.youtube_app_assert()
        sleep(5)
        self.driver.back()

        settings_page.tap_snapchat_icon()
        sleep(5)
        self.driver.back()
        sleep(2)
        self.driver.back()

        settings_page_asserts.hd_switch_assert()
コード例 #3
0
    def whats_new_test(self):
        gridPage = GridPage(self.driver)
        gridPageAsserts = GridPageAsserts(self.driver)

        gridPage.tapWhatsNewBtn()
        sleep(5)
        self.driver.back()
        gridPageAsserts.settingsIconAssert()
コード例 #4
0
    def test_privacy_policy(self):
        grid_page = GridPage(self.driver)
        settings_page = SettingsPage(self.driver)
        asserts = SettingsPageAsserts(self.driver)

        grid_page.tapSettingsIcon()
        settings_page.settings_premium_purchase()
        settings_page.tap_terms_and_conditions()

        asserts.terms_and_conditions_assert()
コード例 #5
0
    def test_write_a_review_in_settings(self):
        grid_page = GridPage(self.driver)
        settings_page = SettingsPage(self.driver)
        asserts = SettingsPageAsserts(self.driver)

        grid_page.tapSettingsIcon()
        settings_page.settings_premium_purchase()
        settings_page.tap_write_a_review()

        asserts.play_store_assert()
コード例 #6
0
    def test_send_feedback_in_settings(self):
        grid_page = GridPage(self.driver)
        settings_page = SettingsPage(self.driver)
        asserts = SettingsPageAsserts(self.driver)

        grid_page.tapSettingsIcon()
        settings_page.settings_premium_purchase()
        settings_page.tap_send_feedback()
        settings_page.tap_gmail_for_feedback()

        asserts.gmail_assert()
コード例 #7
0
    def instasize_btn_test(self):
        gridPage = GridPage(self.driver)
        editorPage = EditorPage(self.driver)
        helper_methods = Helper_Methods(self.driver)

        helper_methods.setupFilter()
        # taps on the yellow instasize button
        editorPage.tapInstasizeButton()
        helper_methods.filterExportInstagram()
        # Asserts the + button is displayed
        gridPage.addPhotoFind()
コード例 #8
0
    def tools_test(self):
        gridPage = GridPage(self.driver)
        helper_methods = Helper_Methods(self.driver)
        editorPage = EditorPage(self.driver)

        helper_methods.setupFilter()
        # taps the tools feature
        editorPage.tapToolsFeature()
        # taps on all tool features
        editorPage.tapOnAllTools()
        helper_methods.filterExportInstagram()
        # Asserts the + button is displayed
        gridPage.addPhotoFind()
コード例 #9
0
    def login_to_profile(self):
        profilePage = ProfilePage(self.driver)
        helper_methods = Helper_Methods(self.driver)
        grid_page = GridPage(self.driver)

        helper_methods.setupFilter()
        helper_methods.filterExportInstagram()
        profilePage.openProfilePage()
        profilePage.tapSignIn()
        profilePage.enterLoginInfo()
        profilePage.tapSignUp()
        grid_page.GDPR_skip()

        gridPageAsserts = GridPageAsserts(self.driver)
        gridPageAsserts.settingsIconAssert()
コード例 #10
0
    def create_new_profile_test(self):
        profilePage = ProfilePage(self.driver)
        helper_methods = Helper_Methods(self.driver)
        gridPageAsserts = GridPageAsserts(self.driver)
        grid_page = GridPage(self.driver)

        helper_methods.setupFilter()
        helper_methods.filterExportInstagram()
        profilePage.openProfilePage()
        profilePage.name_generator()
        profilePage.email_generator()
        profilePage.pw_generator()
        profilePage.tap_profile_image()
        profilePage.tap_first_image_in_gallery()
        profilePage.tap_done_in_gallery()
        profilePage.tapSignUp()
        grid_page.GDPR_skip()

        gridPageAsserts.premium_badge_assert()
コード例 #11
0
    def import_from_cloud(self):
        gridPage = GridPage(self.driver)
        gridPageAsserts = GridPageAsserts(self.driver)
        helper_methods = Helper_Methods(self.driver)
        editor_page = EditorPage(self.driver)

        # taps on the + icon
        gridPage.addPhotoTap()
        # taps on cloud option
        gridPage.tapOnCloudOption()
        # taps on the second image
        gridPage.tapOnCloudImageInSystem()
        editor_page.purchase_premium_editor_popup()
        helper_methods.filterExportInstagram()
        gridPageAsserts.settingsIconAssert()
コード例 #12
0
    def camera_test(self):
        gridPage = GridPage(self.driver)
        helper_methods = Helper_Methods(self.driver)
        editor_page = EditorPage(self.driver)

        gridPage.purchasPremiumEditor()
        gridPage.addPhotoTap()
        # taps on the camera icon
        gridPage.tap_camera_icon()
        # takes a picture
        gridPage.take_photo()
        # taps on ok
        gridPage.tap_camera_ok()
        editor_page.purchase_premium_editor_popup()
        helper_methods.filterExportInstagram()
        gridPage.addPhotoFind()
コード例 #13
0
    def delete_multiple_images(self):
        gridPage = GridPage(self.driver)
        gridPageAsserts = GridPageAsserts(self.driver)
        helper_methods = Helper_Methods(self.driver)

        helper_methods.setupFilter()
        helper_methods.filterExportInstagram()
        helper_methods.setupFilter()
        helper_methods.filterExportInstagram()
        # Taps on the top left image on the grid
        gridPage.tapTopLeftPhotoOnGrid()
        # taps on the second image on grid screen
        gridPage.tap_second_grid_image()
        # Taps on delete icon
        gridPage.tapDeleteIconOnGrid()
        # Taps on cancel
        gridPage.tapCancelButton()
        # Taps on delete icon
        gridPage.tapDeleteIconOnGrid()
        # Taps on delete button in popup
        gridPage.tapDeleteButton()
        gridPageAsserts.settingsIconAssert()
コード例 #14
0
    def delete_image(self):
        gridPage = GridPage(self.driver)
        gridPageAsserts = GridPageAsserts(self.driver)
        helper_methods = Helper_Methods(self.driver)

        helper_methods.setupFilter()
        helper_methods.filterExportInstagram()
        # Taps on the top left image on the grid
        gridPage.tapTopLeftPhotoOnGrid()
        # Taps on delete icon
        gridPage.tapDeleteIconOnGrid()
        # Taps on cancel
        gridPage.tapCancelButton()
        # Taps on delete icon
        gridPage.tapDeleteIconOnGrid()
        # Taps on delete button in popup
        gridPage.tapDeleteButton()
        # Asserts the image was deleted successfully
        gridPageAsserts.gridPagePhotoNotPresent()
コード例 #15
0
    def test_filter_uploads(self):
        driver_builder = DriverBuilderAndroid()
        driver = driver_builder.driver

        # taps on the + icon
        addPhoto = GridPage(driver)
        addPhoto.addPhotoTap()

        # Asserts collapseIcon is displayed
        collapseIcon = GridPage(driver)
        collapseIcon.collapseIconFind()

        # taps on the native photos container
        tapPhotoContainer = GridPage(driver)
        tapPhotoContainer.photoContainers()

        # Asserts allPhotosButton is displayed
        allPhotosButton = PhotoLibraryAsserts(driver)
        allPhotosButton.allPhotosButton()

        # taps on the top left photo
        tap2ndPhoto = GridPage(driver)
        tap2ndPhoto.second_grid_image()

        # taps on the filter
        filters = EditorPage(driver)
        filters.bDayFilter()

        # taps on date spinner
        bDaySpinner = EditorPage(driver)
        bDaySpinner.tapBdayDateSpinner()

        # swipes down on the date spinner
        tapOn1999 = EditorPage(driver)
        tapOn1999.tapBdaySpinnerForInput()

        # taps on create my filter button
        tapOnCreateMyFilter = EditorPage(driver)
        tapOnCreateMyFilter.tapCreateMyFilter()

        # taps on Use Filter
        tapUseFilter = EditorPage(driver)
        tapUseFilter.tapUseFilter()

        # Asserts tvFilterLevel is displayed
        tvFilterLevel = PhotoLibraryAsserts(driver)
        tvFilterLevel.tvFilterLevel()

        # takes a screenshot and pulls it to a specific folder
        sleep(10)
        run('adb shell screencap -p /sdcard/screencap.png', shell=True)
        sleep(10)
        run("adb pull /sdcard/screencap.png /Users/tyler/Desktop/imageComparisonFiles",
            shell=True)

        sleep(10)

        # loads the two input images
        imageA = cv2.imread(
            '/Users/tyler/Desktop/imageComparisonFiles/s6BirthdayScreenshot.png'
        )
        imageB = cv2.imread(
            '/Users/tyler/Desktop/imageComparisonFiles/screencap.png')

        # convert the images to grayscale
        grayA = cv2.cvtColor(imageA, cv2.COLOR_BGR2GRAY)
        grayB = cv2.cvtColor(imageB, cv2.COLOR_BGR2GRAY)

        # compute the Structural Similarity Index (SSIM) between the two images, ensuring that the difference image is returned
        (score, diff) = compare_ssim(grayA, grayB, full=True)
        diff = (diff * 255).astype("uint8")
        SSIM = ("SSIM: {}".format(score))
        print(SSIM)

        if ("{}".format(score)) <= '.80':
            print('SSIM is too low, please test manually', 'FAILED')

        else:
            print('SSIM is within acceptable range')

        # Tears down the test
        quitTest = EditorPage(driver)
        quitTest.driverQuit()