본문 바로가기

코딩/Mobile 자동화 (new)9

appium 자동화 2024 - 9) git - Jenkins 연동 Jenkins 기본 설정 후 + New Item ㄴ Freestyle 로 ㄴ Git Repository URL에 git 주소를 넣어주면 되는데, 위와 같은 에러가 노출되었다. stderr: remote: HTTP Basic: Access denied. The provided password or token is incorrect or your account has 2FA enabled and you must use a personal access token instead of a password. See https://gitlab.com/help/topics/git/troubleshooting_git#error-on-git-fetch-http-basic-access-denied * 트러블 슈팅 히스토리... 2024. 4. 4.
appium 자동화 2024 - 8) PC web + Mobile 동시 자동화 setting.py import pytest from appium import webdriver as appium_webdriver from appium.options.android import UiAutomator2Options from selenium import webdriver as selenium_webdriver from selenium.webdriver import Chrome # appium 세팅 @pytest.fixture(scope="module") def driver_m(): capabilities = dict( platformName='Android', automationName='uiautomator2' ) appium_server_url = 'http://localhost:472.. 2024. 3. 29.
appium 자동화 2024 - 6) Git 레파지토리 생성 > 로컬 프로젝트 업로드 하기 brew install git 맥 터미널 git 설치 https://github.com/ GitHub: Let’s build from here GitHub is where over 100 million developers shape the future of software, together. Contribute to the open source community, manage your Git repositories, review code like a pro, track bugs and fea... github.com 1. github 회원가입 2. 오른쪽 상단 프로필 파일 > Your repositories > New 로 레파지토리 생성 3. 맥 터미널 > 기존에 만들어둔 프로젝트로 위치 후 깃 레파지토.. 2024. 3. 3.
appium 자동화 2024 - 5) 소스 코드 구조화 이전에 짰던 하나의 소스코드를 구조화 import pytest from appium import webdriver from appium.options.android import UiAutomator2Options from selenium.common import TimeoutException from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from appium.webdriver import WebElement from selenium.webdriver.support.wait import WebDriverWait # 1. 기다렸다가 클릭하는 함수 wait_Ele.. 2024. 2. 22.
appium 자동화 2024 - 4) Pytest+appium 자동화 구현 1. Appium 실행 맥 터미널 > appium 앱피움 실행 확인 2. Appium Inspector ㄴ 우선 가장 기본적인 세팅값 설정 후, 하단 Start Session 클릭 ㄴ 미러링이 되며, 각 Element 를 선택할수 있게된다. ㄴ 시계를 실행시키기 위해, 시계 아이콘을 선택하면 위와같이 Element 정보가 노출된다. ㄴ 위에서 xpath 값을 복사해둔다. //android.widget.TextView[@content-desc="시계"] 3. Python 소스코드 앞서 설치 했던 Pytest 테스트 포맷으로 통해 소스코드를 작성한다. 구조화 되기 전 단일 코드로 작성하는 단계 import pytest from appium import webdriver from appium.options.a.. 2024. 2. 21.
안드로이드 미러링 2가지 방법 (안드로이드 스튜디오/scrcpy) 안드로이드 미러링 1. 안드로이드 스튜디오 활용 안드로이드 세팅 > device mirroring 검색 ㄴ Active.. physical.. 선택 ㄴ 안드로이드 우측 하단 Runnung Devices 선택 ㄴ Device Manager > 요 버튼을 눌러보면 미러링 성공 2. brew > scrcpy 활용 맥 터미널 > brew install scrcpy 명령어로 scrcpy 설치 후, adb 설치 된 상태 + 기기 설정 > USB 디버깅 허용 + 유선 연결된 상태라면, 터미널에서 scrcpy 명령어 쳐주면 화면 미러링 된다. https://salzzak.tistory.com/78 생각을 읽는 대머리 학생 1화 salzzak.tistory.com 2024. 2. 21.
appium 자동화 2024 - 3) Pytest 예제 https://docs.pytest.org/en/7.4.x/getting-started.html pip install -U pytest ㄴ 맥 터미널에서 설치 성공 # content of test_sample.py def func(x): return x + 1 def test_answer(): assert func(3) == 5 ㄴ 코드 입력 후 ㄴ pytest 테스트파일.py 명령어로 간단하게 테스트 동작 확인. https://salzzak.tistory.com/95 미국식 의료 개그 만화 1 salzzak.tistory.com 2024. 2. 20.
appium 자동화 2024 - 2) Write the Test(Python/Pytest) 우선 Pycharm 을 설치하고 간단하게 동작하는지도 확인ㄴ 잘 동작한다. https://appium.io/docs/en/2.4/quickstart/test-py/ 위 페이지에 있는 코드를 복붙해보자.# test.py import unittest from appium import webdriver from appium.options.android import UiAutomator2Options from appium.webdriver.common.appiumby import AppiumBy capabilities = dict( platformName='Android', automationName='uiautomator2', deviceName='Android', appPackage='com.android... 2024. 2. 20.
appium 자동화 2024 - 1) 기본 세팅 (Appium/UiAutomator2/Appium Inspector) * 현재는 Android 기준으로 작성, iOS 세팅 내용 추가 예정Install Appium https://brew.sh/ https://appium.io/docs/en/2.4/quickstart/install 맥 터미널에 입력/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 설치 내용 마지막 쯤에 있는 Next steps 명령어를 복붙해서 실행brew install npmㄴ brew > npm 설치 npm i -g appiumㄴ npm > appium 설치 Install the UiAutomator2 Driverhttps://appium.io/docs/en/2.4/quickstar.. 2024. 2. 20.