diff --git a/.ado/templates/e2e-test-job.yml b/.ado/templates/e2e-test-job.yml index 3a79cfaecd4..b6e61d42af7 100644 --- a/.ado/templates/e2e-test-job.yml +++ b/.ado/templates/e2e-test-job.yml @@ -96,6 +96,21 @@ jobs: script: yarn run test workingDirectory: packages/E2ETest + - task: CopyFiles@2 + displayName: Copy tree dump output files + inputs: + sourceFolder: $(LocalAppData)\Packages\ReactUWPTestApp_kc2bncckyf4ap\LocalState + targetFolder: $(Build.StagingDirectory)/ReactUWPTestAppTreeDump + contents: TreeDump\** + condition: succeededOrFailed() + + - task: PublishBuildArtifacts@1 + displayName: "Publish Artifact:ReactUWPTestAppTreeDump" + inputs: + artifactName: ReactUWPTestAppTreeDump + pathtoPublish: $(Build.StagingDirectory)/ReactUWPTestAppTreeDump + condition: succeededOrFailed() + - task: PublishTestResults@2 inputs: testResultsFormat: "JUnit" diff --git a/change/react-native-windows-2019-12-10-12-31-34-treedump.json b/change/react-native-windows-2019-12-10-12-31-34-treedump.json new file mode 100644 index 00000000000..14cfc4b5c6f --- /dev/null +++ b/change/react-native-windows-2019-12-10-12-31-34-treedump.json @@ -0,0 +1,8 @@ +{ + "type": "prerelease", + "comment": "TreeDump for E2E test and fix for image border issue", + "packageName": "react-native-windows", + "email": "dida@ntdev.microsoft.com", + "commit": "88f9b0eaecfe88e2243b66d969420131224f1c56", + "date": "2019-12-10T20:31:33.939Z" +} \ No newline at end of file diff --git a/packages/E2ETest/app/Consts.ts b/packages/E2ETest/app/Consts.ts index c6e0246d04a..d8f29264284 100644 --- a/packages/E2ETest/app/Consts.ts +++ b/packages/E2ETest/app/Consts.ts @@ -4,6 +4,7 @@ export const APP_NAME = 'ReactUWPTestApp'; export const SEARCH_BUTTON = 'SearchButton'; export const HOME_BUTTON = '_HomeButton'; export const REACT_CONTROL_ERROR_TEST_ID = 'ReactControlErrorMessage'; +export const TREE_DUMP_RESULT = 'TreeDump'; // UnknownTestPage export const UNKNOWN_TESTPAGE = 'UnknownTestPage'; @@ -31,3 +32,9 @@ export const ACCESSBILITY_TESTPAGE = 'AccessiblityTestPage'; export const DIRECT_MANIPULATION_TESTPAGE = 'DirectManipulationTestPage'; export const MEASURE_IN_WINDOW_BUTTON = 'MeasureInWindow'; export const MEASURE_IN_WINDOW_RESULT = 'MeasureInWindowResult'; + +// Image Test Page +export const IMAGE_TESTPAGE = 'ImageTestPage'; +export const IMAGE_CHANGE_BORDER = 'ChangeBorder'; +export const SHOW_IMAGE_BORDER = 'BorderButton'; +export const IMAGE_CONTAINER = 'ImageContainer'; diff --git a/packages/E2ETest/app/ImageTestPage.tsx b/packages/E2ETest/app/ImageTestPage.tsx new file mode 100644 index 00000000000..3ca2d302647 --- /dev/null +++ b/packages/E2ETest/app/ImageTestPage.tsx @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + */ + +import {StyleSheet, View, Image, Button, requireNativeComponent} from 'react-native' +import React, { useState } from 'react'; +import { TREE_DUMP_RESULT, SHOW_IMAGE_BORDER, IMAGE_CONTAINER } from './Consts'; +const TreeDumpControl = requireNativeComponent('TreeDumpControl'); + +const styles = StyleSheet.create({ + container: { + height:300, + width:500, + backgroundColor: 'yellow', + alignItems:'center', + }, + containerWithBorder: { + height:300, + width:500, + borderRadius: 10.0, + borderWidth:10, + borderColor: '#00ff0055', + backgroundColor: 'yellow', + alignItems:'center', + }, + imageWithBorder: { + height: '100%', + width: '100%', + borderRadius: 10.0, + borderWidth:10, + borderColor: '#0000ff55', + backgroundColor: 'red', + }, + image: { + height: '100%', + width: '100%', + backgroundColor: 'red', + }, + treeDumpControl: { + height: 150, + width: 500, + margin: 10, + }, +}); + +export function ImageTestPage() { + const [imageWithBorder, setImageBorder] = useState(false); + const [clickCount, setClickCount] = useState(0); + const onPressBorder = () => { + var previousImageBorderState = imageWithBorder; + setImageBorder(!previousImageBorderState); + var previousClickCount = clickCount; + setClickCount(previousClickCount+1); + } + return( + + + + +