Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "prerelease",
"comment": "Fix cornerRadius issue for TextInput and some updates to TreeDump",
"packageName": "react-native-windows",
"email": "[email protected]",
"commit": "d2ab5205ec27f1784a54a82236c54b9c13531412",
"date": "2019-12-17T21:09:02.950Z"
}
3 changes: 2 additions & 1 deletion packages/E2ETest/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
/build
/reports
/dist
/windows/ReactUWPTestApp/Bundle/
/windows/ReactUWPTestApp/Bundle/
msbuild.binlog
4 changes: 4 additions & 0 deletions packages/E2ETest/app/Consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@ export const IMAGE_TESTPAGE = 'ImageTestPage';
export const IMAGE_CHANGE_BORDER = 'ChangeBorder';
export const SHOW_IMAGE_BORDER = 'BorderButton';
export const IMAGE_CONTAINER = 'ImageContainer';

// Control Style Test Page
export const CONTROL_STYLE_TESTPAGE = 'ControlStylePage';
export const SHOWBORDER_ON_CONTROLSTYLE = 'ShowBorder';
82 changes: 82 additions & 0 deletions packages/E2ETest/app/ControlStyle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/

import { Switch, CheckBox, TextInput, View, StyleSheet, Button } from 'react-native';
import {DatePicker, Picker} from 'react-native-windows';
Copy link
Contributor

@licanhua licanhua Dec 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DatePicker, Picker [](start = 8, length = 18)

Add spaces
{ DatePicker.. }
apply to other import too #Closed

import React, { useState } from 'react';
import {SHOWBORDER_ON_CONTROLSTYLE, TREE_DUMP_RESULT} from './Consts';
import {TreeDumpControl} from './TreeDump'

const styles = StyleSheet.create({
container: {
padding: 20
},
regularBorder: {
height: 50,
backgroundColor: 'rgba(225,225,225,0.2)',
borderWidth:1,
borderColor: '#ff00ff55',
marginBottom: 10,
padding: 10,
color: '#fff'
},
roundBorder: {
height: 50,
backgroundColor: 'rgba(0,0,0,0.2)',
marginBottom: 10,
padding: 10,
color: '#000',
borderRadius: 10.0,
borderWidth:10,
borderColor: '#00ff0055',
},
buttonText: {
color: '#fff',
textAlign: 'center',
fontWeight: '700',
borderRadius: 10.0,
},
treeDumpControl: {
height: 150,
width: 500,
margin: 10,
},
});

export function ControlStylePage() {
Copy link
Contributor

@licanhua licanhua Dec 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ControlStylePage [](start = 16, length = 16)

rename this file to ControlStylePage too #Closed

const [showRoundBorder, setShowRoundBorder] = useState(false);

const onPressShowRoundBorder = () => {
var previousState = showRoundBorder;
setShowRoundBorder(!previousState);
}

return (
<View>
<View testID={'ControlStyleView'}>
<Switch style={showRoundBorder? styles.roundBorder :styles.regularBorder} thumbColor='blue'/>
<CheckBox style={showRoundBorder? styles.roundBorder :styles.regularBorder} />
<TextInput style={showRoundBorder? styles.roundBorder :styles.regularBorder}
placeholder='TextBox'
placeholderTextColor='rgba(225,225,225,0.7)'
editable={false} />

<TextInput style={showRoundBorder? styles.roundBorder :styles.regularBorder}
placeholder='Password'
placeholderTextColor='rgba(225,225,225,0.7)'
secureTextEntry = {true}
editable={false}/>
<DatePicker style={showRoundBorder? styles.roundBorder :styles.regularBorder}/>
<Picker style={showRoundBorder? styles.roundBorder :styles.regularBorder}/>
</View>

<Button title= {showRoundBorder?"Hide Round Border":"Show Round Border"}
onPress={onPressShowRoundBorder}
testID={SHOWBORDER_ON_CONTROLSTYLE}/>

<TreeDumpControl style={styles.treeDumpControl} dumpID={showRoundBorder?'ControlStyleRoundBorder':'ControlStyleRegularBorder'} uiaID={'ControlStyleView'} testID={TREE_DUMP_RESULT} />

</View >);
}
6 changes: 3 additions & 3 deletions packages/E2ETest/app/ImageTestPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* Licensed under the MIT License.
*/

import {StyleSheet, View, Image, Button, requireNativeComponent} from 'react-native'
import {StyleSheet, View, Image, Button} from 'react-native'
import React, { useState } from 'react';
import { TREE_DUMP_RESULT, SHOW_IMAGE_BORDER, IMAGE_CONTAINER } from './Consts';
const TreeDumpControl = requireNativeComponent('TreeDumpControl');
import { SHOW_IMAGE_BORDER, IMAGE_CONTAINER, TREE_DUMP_RESULT } from './Consts';
import {TreeDumpControl} from './TreeDump'
Copy link
Contributor

@licanhua licanhua Dec 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TreeDumpControl [](start = 8, length = 15)

space around it #Closed


const styles = StyleSheet.create({
container: {
Expand Down
7 changes: 7 additions & 0 deletions packages/E2ETest/app/TestPages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ import {
ACCESSBILITY_TESTPAGE,
DIRECT_MANIPULATION_TESTPAGE,
IMAGE_TESTPAGE,
CONTROL_STYLE_TESTPAGE,
} from './Consts';
import { LoginTestPage } from './LoginTestPage';
import { AccessibilityTestPage } from './AccessibilityTestPage';
import { DirectManipulationTestPage } from './DirectManipulationPage';
import { ImageTestPage } from './ImageTestPage';
import { ControlStylePage } from './ControlStyle';

export interface ITestPage {
testId: string;
Expand Down Expand Up @@ -52,6 +54,11 @@ const TestPages: ITestPage[] = [
description: 'Image Test Page',
content: ImageTestPage,
},
{
testId: CONTROL_STYLE_TESTPAGE,
description: 'Control Style Test Page',
content: ControlStylePage,
},
{
testId: UNKNOWN_TESTPAGE,
description: 'Unknown Page',
Expand Down
2 changes: 2 additions & 0 deletions packages/E2ETest/app/TreeDump.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { requireNativeComponent } from 'react-native';
Copy link
Contributor

@licanhua licanhua Dec 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copyright #Closed

export const TreeDumpControl = requireNativeComponent('TreeDumpControl');
Copy link
Contributor

@licanhua licanhua Dec 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TreeDumpControl [](start = 13, length = 15)

the filename to be TreeDumpControl.ts? #Closed

28 changes: 28 additions & 0 deletions packages/E2ETest/wdio/pages/ControlStylePage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/

import { BasePage, By } from './BasePage';
import { SHOWBORDER_ON_CONTROLSTYLE } from '../../app/Consts';

class TextInputStyleTestPage extends BasePage {
Copy link
Contributor

@licanhua licanhua Dec 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TextInputStyleTestPage [](start = 6, length = 22)

rename it to ControlStyleTestPage? #Closed

backToHomePage() {
this.homeButton.click();
this.waitForPageLoaded();
}

isPageLoaded() {
return super.isPageLoaded();
}

toggleControlBorder() {
this._controlBorder.click();
}

private get _controlBorder() {
return By(SHOWBORDER_ON_CONTROLSTYLE);
}
}

export default new TextInputStyleTestPage();
11 changes: 11 additions & 0 deletions packages/E2ETest/wdio/pages/HomePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ import {
LOGIN_TESTPAGE,
DIRECT_MANIPULATION_TESTPAGE,
IMAGE_TESTPAGE,
CONTROL_STYLE_TESTPAGE,
} from '../../app/Consts';
import LoginPage from './LoginPage';
import DirectManipulationPage from './DirectManipulationPage';
import ImageTestPage from './ImageTestPage';
import ControlStyleTestPage from './ControlStylePage';

class HomePage extends BasePage {
backToHomePage() {
Expand Down Expand Up @@ -45,6 +47,11 @@ class HomePage extends BasePage {
ImageTestPage.waitForPageLoaded();
}

clickAndGotoControlStylePage() {
this.ControlStylePageButton.click();
ControlStyleTestPage.waitForPageLoaded();
}

private get testInputTestPageButton() {
return By(TEXTINPUT_TESTPAGE);
}
Expand All @@ -60,6 +67,10 @@ class HomePage extends BasePage {
private get ImagePageButton() {
return By(IMAGE_TESTPAGE);
}

private get ControlStylePageButton() {
return By(CONTROL_STYLE_TESTPAGE);
}
}

export default new HomePage();
2 changes: 1 addition & 1 deletion packages/E2ETest/wdio/test/Image.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('ImageWithoutBorderTest', () => {
assert(result, '#2. Dump comparison for image with border!');
});

/* Test case #3: Click button one more, remove border from view and image but tree sturcture is different from #1*/
/* Test case #3: Click button one more, remove border from view and image but tree sturcture is different from #1*/
it('ImageWithoutBorderTest', () => {
ImageTestPage.toggleImageBorder();
const result = ImageTestPage.getTreeDumpResult();
Expand Down
41 changes: 41 additions & 0 deletions packages/E2ETest/wdio/test/controlStyle.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/

import HomePage from '../pages/HomePage';
import ControlStyleTestPage from '../pages/ControlStylePage';
import assert from 'assert';

beforeAll(() => {
HomePage.backToHomePage();
HomePage.clickAndGotoControlStylePage();
});

describe('ControlStyleTest', () => {
/* Test case #1: Controls style with regular border */
it('ControlStyleTestWithRegularBorder', () => {
const result = ControlStyleTestPage.getTreeDumpResult();
assert(
result,
'#1. Dump comparison for Control style with regular border!'
);
});

/* Test case #2: Click button once, update controls style and round border*/
it('ControlStyleTestWithRoundBorder', () => {
ControlStyleTestPage.toggleControlBorder();
const result = ControlStyleTestPage.getTreeDumpResult();
assert(result, '#2. Dump comparison for Control style with round border!');
});

/* Test case #3: Click button one more, return to #1*/
it('ControlStyleTestWithRegularBorder #2', () => {
ControlStyleTestPage.toggleControlBorder();
const result = ControlStyleTestPage.getTreeDumpResult();
assert(
result,
'#3. Second dump comparison for Control style with regular border!'
);
});
});
Loading