Slide 1

Slide 1 text

UI Test with Compose Incheon/Songdo

Slide 2

Slide 2 text

What is the Purpose of this Session? UI Test੄ ਗܻܳ ঌҊ पઁ ೐۽ં౟ ੸ਊ

Slide 3

Slide 3 text

1. UI Testۆ - UI Test о ޖ঺ੋ૑ ࢓ಝࠇפ׮. Incheon/Songdo 2. UI Test with XML - XML ӝ߈ UI Testܳ ૓೯೤פ׮. 3. UI Test with Compose - Compose ӝ߈ UI Testܳ ૓೯೤פ׮.

Slide 4

Slide 4 text

1. UI Test Incheon/Songdo

Slide 5

Slide 5 text

What is the Test? - য়ܨ ध߹ - ࢿמ ഛੋ - ࢎਊ੗ ਃҳࢎ೦ ഛੋ - উ੹ࢿ ಣо

Slide 6

Slide 6 text

Advantages and Disadvantages of Testing పझ౟о হ׮ݶ ੘স ୡ߈ࠗী ࢤ࢑ࢿਸ ֫ੌ ࣻ ੓ णפ׮. Ӓۧ૑݅ दр੉ ૑զࣻ۾ ৘࢚஖ ޅೠ ী۞੄ ߊࢤ, ࠂ੟ೠ ௏٘ ١ਵ۽ ੋ೧ ੘স ࣗਃ दрਸ ૐоೞѱ ؾפ׮. ৘ܳ ٜয, ౠ੿ ௏٘ܳ ࣻ੿೮חؘ ৘࢚஖ ޅೠ ௏٘ ীࢲ ী۞о ߊࢤೡ ࣻ ੓णפ׮. ੉ٸ పझ౟о হ׮ ݶ ੉ܳ ഛੋೡ ࣻ হणפ׮. పझ౟о হח ೐۽ં౟੄ ҃਋ द੘਷ ਬܻೞ૑݅, ੉ղ ૓ୋ੉ হਸ ੿ب۽ ו ۰૓׮. / Unit Testing

Slide 7

Slide 7 text

How to make good Test? - ാࣚ੄ ੿ഛೠ х૑ - ࣁࠗ ҳഅ ࢎ೦ী ة݀੸ - ੜ ࢸݺغח पಁ - ੉೧ೡ ࣻ ੓ח పझ౟ ௏٘ - औҊ ࡅܰѱ प೯

Slide 8

Slide 8 text

Test Case - ળ࠺ arrange : పझ౟ܳ ૓೯ೞӝ ਤ೧ ജ҃ ࢸ੿ (੄ઓࢿ ࢸ੿, పझ౟ ؀࢚੉ غח ௿ېझ੄ ੋझఢझܳ ৢ߄ܰѱ ࢸ੿ೞҊ ࢤࢿ ١) - प೯ act : పझ౟ ઺ੋ ز੘ਸ पઁ۽ ഐ୹ೞח ௏٘ܳ աఋմ׮. - ױ঱ assert : పझ౟ ઺ੋ ز੘੉ प೯غҊ աݶ पઁ۽ ৢ߄ܲ ੌ੉ ߊࢤ೮ח૑ ഛੋ೧ঠ ೠ׮. ৈӝীח ੌ߈੸ਵ۽ ߈ജч੉ ৘࢚ೠ чҗ эѢա ੌࠗ ҃җ ࢚కо ৘࢚җ э਷૑ ഛੋೞח ੘ স੉ ನೣ.

Slide 9

Slide 9 text

Types of Tests - Unit Test - Integration Test - UI Test

Slide 10

Slide 10 text

Types of Tests Unit Test - ੘਷ ௏٘ ઑпਸ ѨૐೞҊ - ࡅܰѱ ࣻ೯ೞҊ - Ѻܻػ ߑधਵ۽ ୊ܻೠ׮.

Slide 11

Slide 11 text

Types of Tests Integration Test - ױੌ ز੘ ױਤܳ ѨૐೞҊ - ࡅܰѱ ࣻ೯ೞҊ - ׮ܲ పझ౟৬ ߹ب۽ ୊ܻೠ׮. * ױਤపझ౟ী݅ ੄ઓೞݶ दझమ੉ ੹୓੸ਵ۽ ੜ ز੘ೞח૑ ഛन ࠛоמ.

Slide 12

Slide 12 text

Types of Tests UI Test (GUI Test) - ചݶ ղীࢲ੄ Action੉ ઁ؀۽ ੘زೞח૑ ഛੋ. - ݽٚ ز੘ী ؀೧ ೞաೞա ࢚ࣁ൤ ഛੋೞח Ѫ੉ য۵׮. Ӓۧӝ ٸޙী ੉۞ೠ Actionী ؀೧ ௏٘۽ ۽ ૒ਸ ૞֬਷ റী, ૑ࣘ੸ਵ۽ ҙܻೞח Ѫ੉ ੢ӝ੸ਵ۽ח ݒ਋ ಞܻೞ׮. - ୶о੸ਵ۽ ৘࢚஖ ޅೠ UI ղীࢲ੄ جߊ࢚ടীب ؀୊ оמೞ׮.

Slide 13

Slide 13 text

UI Test Espresso Robolectric Appium UI Automator

Slide 14

Slide 14 text

2. XML Incheon/Songdo

Slide 15

Slide 15 text

What is the XML? XML(Extensible Markup Language): ഛ੢ഋ ݃௼স ঱য੉ݴ Android Studioীࢲ ചݶਸ Ӓܻחؘ ࢎਊػ׮.

Slide 16

Slide 16 text

What is the Espresso? Android ӝӝ ߂ ীޯۨ੉ఠীࢲ UI Test ૓೯ Espresso੄ ӝࠄ ҳࢿ ਃࣗ - Espresso : onView() / onData()ܳ ాೠ ࠭৬੄ ࢚ഐ੘ਊਸ ਤೠ ૓ੑ੼ - ViewMatchers : അ੤ view ҅க ҳઑ ղীࢲ పझ౟ೡ ؀࢚ ଺ӝ - ViewActions : ࣻ೯ೡ ز੘ - ViewAssertions : ࣻ೯ೠ ز੘ ഛੋ https://developer.android.com/training/testing/espresso/basics?hl=ko

Slide 17

Slide 17 text

Espresso UI Test ࣽࢲ Find ೧׼ ஹನք౟ ଺ӝ Action ౠ੿ ӝמ ࣻ೯ Assert ౠ੿ ӝמী ؀ೠ Ѿҗ ഛੋ

Slide 18

Slide 18 text

Espresso UI Test Espresso UI test method ࣗѐ

Slide 19

Slide 19 text

https://developer.android.com/training/testing/espresso/cheat-sheet?hl=ko What is the Espresso?

Slide 20

Slide 20 text

View Matcher : ਗೞח view ଺ӝ - withId - withText - withContentDescription - … What is the Espresso?

Slide 21

Slide 21 text

View Action - click() - longClick() - scrollTo() - swipeRight() What is the Espresso?

Slide 22

Slide 22 text

View Assertion - withText() - doesNotExist() - … What is the Espresso?

Slide 23

Slide 23 text

Left Aligned Title

Slide 24

Slide 24 text

2. XML Incheon/Songdo - Button ߂ EditText UITest

Slide 25

Slide 25 text

Left Aligned Title

Slide 26

Slide 26 text

Left Aligned Title

Slide 27

Slide 27 text

Left Aligned Title

Slide 28

Slide 28 text

Left Aligned Title

Slide 29

Slide 29 text

Left Aligned Title

Slide 30

Slide 30 text

Left Aligned Title

Slide 31

Slide 31 text

Left Aligned Title

Slide 32

Slide 32 text

Left Aligned Title

Slide 33

Slide 33 text

What is the Test?

Slide 34

Slide 34 text

What is the Test?

Slide 35

Slide 35 text

Left Aligned Title

Slide 36

Slide 36 text

What is the Test?

Slide 37

Slide 37 text

3. Compose Incheon/Songdo

Slide 38

Slide 38 text

What is the Jetpack Compose? Jetpack Composeח ֎੉౭࠳ Android UIܳ ࠽٘ೞӝ ਤೠ ୭न بҳ ః౟. - ௏٘ хࣗ - ૒ҙ੸ - ࡅܲ ѐߊ җ੿ - ъ۱ೠ ࢿמ

Slide 39

Slide 39 text

What is the Test?

Slide 40

Slide 40 text

XMLҗ Compose੄ ର੉੼? - ݺ۸ഋ UI / ࢶ঱ഋ UI - ௏٘੄ ܻ࠙ - view id

Slide 41

Slide 41 text

What is the Test? Jetpack Composeীࢲח যڌѱ పझ౟ ؀࢚ਸ ଺૑?

Slide 42

Slide 42 text

3. Compose Incheon/Songdo - Semantic

Slide 43

Slide 43 text

Semantic Semantic - UI ҅க ҳઑ৬ ࢚ഐ੘ਊ೤פ׮. - दݔ౮਷ UI ਃࣗী ੄޷ܳ ࠗৈ - दݔ౮ ౟ܻח UI ҅க ҳઑ৬ ೣԋ ࢤࢿغҊ UI ҅க ҳઑܳ ഋࢿ ೤פ׮. Compose పझ౟ীࢲח दݔ౮ ౟ܻۄח ҳઑܳ ࢎਊೞ ৈ ചݶীࢲ ਃࣗܳ ଺ই ࣘࢿਸ ੍ਸ ࣻ ੓णפ׮.

Slide 44

Slide 44 text

Semantic Semantic

Slide 45

Slide 45 text

Semantic Semantic

Slide 46

Slide 46 text

What is the Node? + ֢٘ח ޖ঺? ‘दݔ౮ ੄޷о ੓ח UI౟ܻ੄ ݽٚ ֢٘ীח दݔ౮ ౟ܻী ߽۳ ֢٘о ੓णפ׮. दݔ౮ ౟ܻ੄ ֢٘ীח ࢚ ਽ೞח ஹನ੷࠶੄ ੄޷ܳ ੹׳ೞח ࣘࢿ੉ ನೣغয ੓णפ׮.’

Slide 47

Slide 47 text

Semantic ֢٘ח ޖ঺?

Slide 48

Slide 48 text

Semantic modifier.semantics

Slide 49

Slide 49 text

Semantic SemanticsPropertyReceiverਸ ࢎਊ೧ࢲ Semantic propertyܳ Custom೧ࢲ ࢎਊ оמ

Slide 50

Slide 50 text

Semantic Now In Android https://github.com/android/nowinandroid

Slide 51

Slide 51 text

Semantic tree visualization Scemantic ౟ܻ दпച. - Layout Inspector بҳ ࢎਊ - printToLog() ݫࢲ٘ ੉ਊ.

Slide 52

Slide 52 text

Semantic tree visualization - Layout Inspector Menu - Tools - Layout Inspectorਵ۽ ੽Ӕ

Slide 53

Slide 53 text

Semantic tree visualization - Layout Inspector Semantic Tree ܳ ഛੋೡ ࣻ হח ҃਋ - compose UI ҙ۲ ୭न ߡ੹ ࢎਊ - Api > 29 https://stackoverflow.com/questions/75542760/compose-inspection-unavailable- could-not-determine-the-version-of-the-androidx

Slide 54

Slide 54 text

Semantic tree visualization - Layout Inspector https://developer.android.com/jetpack/compose/tooling/layout-inspector?hl=ko

Slide 55

Slide 55 text

Semantic tree visualization - printToLog() UI పझ౟ ௏٘ ੑ۱

Slide 56

Slide 56 text

Semantic tree visualization - printToLog()

Slide 57

Slide 57 text

౟ܻ ߽೤ ߽೤غ૑ ঋ਷ ౟ܻо ؼ ਃࣗ੄ ֢٘ܳ ੌ஖दெঠ ೠ׮ݶ useUnMergedTreeܳ true۽ ࢸ੿ೞݶ ؾפ׮.

Slide 58

Slide 58 text

Left Aligned Title

Slide 59

Slide 59 text

Left Aligned Title

Slide 60

Slide 60 text

Semantic Error ߽೤੉ ػ ҃਋ী ੿ഛೠ чਸ о૑Ҋ ੓૑ ঋח ҃਋ ઓ੤. ੉ ٸ modifier.semantics ߂ clearAndSetSemanticsܳ ࢎਊೞৈ ૒੽੸ਵ۽ ࣘࢿਸ ૒੽ ࢸ҅ೞѢա ੤੿ ੄ೡ ࣻ ੓਺.

Slide 61

Slide 61 text

3. Compose Incheon/Songdo - Compose Basic UI Test

Slide 62

Slide 62 text

Compose UI Test Methods https://developer.android.com/jetpack/compose/testing-cheatsheet?hl=ko

Slide 63

Slide 63 text

Compose UI Test Methods https://developer.android.com/jetpack/compose/testing-cheatsheet?hl=ko

Slide 64

Slide 64 text

Finders - onNode - onNodeWithContentDescription - onNodeWithTag - onAllNodes https://developer.android.com/jetpack/compose/testing-cheatsheet?hl=ko Compose UI Test Methods

Slide 65

Slide 65 text

Left Aligned Title

Slide 66

Slide 66 text

Compose UI Test Methods https://developer.android.com/jetpack/compose/testing-cheatsheet?hl=ko Matchers - hasScrollTo - has(No)ClickAction - hasTestTag - …

Slide 67

Slide 67 text

Compose UI Test Methods Actions - performClick - performScrollTo - performImeAction - … https://developer.android.com/jetpack/compose/testing-cheatsheet?hl=ko

Slide 68

Slide 68 text

Compose UI Test Methods Assertion - assert - assertExist - assertIsSelected - assertIsEqualTo - … https://developer.android.com/jetpack/compose/testing-cheatsheet?hl=ko

Slide 69

Slide 69 text

Left Aligned Title

Slide 70

Slide 70 text

Compose UI Test Methods Debug - printToLog() - … https://developer.android.com/jetpack/compose/testing-cheatsheet?hl=ko

Slide 71

Slide 71 text

Left Aligned Title

Slide 72

Slide 72 text

Left Aligned Title

Slide 73

Slide 73 text

Left Aligned Title

Slide 74

Slide 74 text

Compose UI Test Compose Animation UI Test

Slide 75

Slide 75 text

Compose UI Test

Slide 76

Slide 76 text

3. Compose Incheon/Songdo - Compose Animation UI Test

Slide 77

Slide 77 text

Compose Animation UI Test - Composeܳ ࢎਊೣਵ۽ॄ, গפݫ੉࣌ పझ౟о ૓೯ؼ ٸ ࣗਃغח दрী ؀೧ ৮߷ೞ ѱ ઁযо оמ೤פ׮. - ੉ܳ ా೧ গפݫ੉࣌੉ ૓೯غח زউ ઺р чী ؀ೠ ഛੋ੉ оמ೧૘פ׮.

Slide 78

Slide 78 text

Left Aligned Title autoAdvance = false ܳ ా೧ গפݫ੉࣌ दрਸ ઁযೡ ࣻ ੓णפ׮.

Slide 79

Slide 79 text

Left Aligned Title enabled = trueীࢲ গפݫ੉࣌ द੘ advanceTimeBy ܳ ࢎਊೞৈ ਗೞח द੼ਵ۽ ੉ز ৘࢚غח Ѿҗ৬ ࠺Ү ߂ ഛੋ

Slide 80

Slide 80 text

Left Aligned Title ੹୓ ௏٘

Slide 81

Slide 81 text

3. Compose Incheon/Songdo - Compose Navigation UI Test

Slide 82

Slide 82 text

Left Aligned Title

Slide 83

Slide 83 text

Left Aligned Title

Slide 84

Slide 84 text

Left Aligned Title

Slide 85

Slide 85 text

3. Compose Incheon/Songdo - Now In Android

Slide 86

Slide 86 text

Left Aligned Title

Slide 87

Slide 87 text

Left Aligned Title

Slide 88

Slide 88 text

ਃড Find - Action - Assert

Slide 89

Slide 89 text

QnA Incheon/Songdo

Slide 90

Slide 90 text

хࢎ೤פ׮.