Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-26973] iOS: Add accessibilityIdentifier #10864

Merged
merged 7 commits into from May 16, 2019

Conversation

drauggres
Copy link
Contributor

https://jira.appcelerator.org/browse/TIMOB-26973

Compose accessibilityIdentifier for views on iOS the same way content description is composed on Android.

For UI testing purposes compose "accessibilityIdentifier" property for views (same way it's done
with "contentDescription" on Android).

fix TIMOB-26973
@build build added this to the 8.1.0 milestone Apr 22, 2019
@build build requested a review from a team April 22, 2019 18:04
@build
Copy link
Contributor

build commented Apr 22, 2019

Messages
📖

💾 Here's the generated SDK zipfile.

📖 🎉 Another contribution from our awesome community member, drauggres! Thanks again for helping us make Titanium SDK better. 👍
📖

✅ All tests are passing
Nice one! All 3755 tests are passing.
(There are 468 tests skipped)

Generated by 🚫 dangerJS against 3230af2

@davidvivianoASICS
Copy link

davidvivianoASICS commented Apr 29, 2019

Hello,

Is there an ETA of how long this PR will take to make it to production/next Titanium release (8.1.0?)? accessibility-id's are something our team has been needing for QA automation and we are looking forward to their addition.

Copy link
Contributor

@vijaysingh-axway vijaysingh-axway left a comment

Choose a reason for hiding this comment

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

@drauggres Can you please document the properties? And please address two minor comments as well.
Can you give test case so that QE can verify this?
Thanks!

iphone/TitaniumKit/TitaniumKit/Sources/API/TiUtils.h Outdated Show resolved Hide resolved
iphone/TitaniumKit/TitaniumKit/Sources/API/TiUtils.m Outdated Show resolved Hide resolved
iphone/TitaniumKit/TitaniumKit/Sources/API/TiUtils.m Outdated Show resolved Hide resolved
@drauggres
Copy link
Contributor Author

var win = Ti.UI.createWindow({
	backgroundColor: 'white',
	layout: 'vertical'
});

function getHex() {
	var a = (Math.random() * 256 | 0).toString(16);
	if (a.length < 2) {
		a = '0' + a;
	}
	return a;
}
function getRandomColor() {
	return '#' + getHex() + getHex() + getHex();
}

var view1 = Ti.UI.createView({
	backgroundColor: getRandomColor(),
	accessibilityLabel: 'view1Label',
	height: 10,
	width: Ti.UI.FILL
});

var view2 = Ti.UI.createView({
	backgroundColor: getRandomColor(),
	accessibilityValue: 'view3Value',
	height: 10,
	width: Ti.UI.FILL
});

var view3 = Ti.UI.createView({
	backgroundColor: getRandomColor(),
	accessibilityHint: 'view3Hint',
	height: 10,
	width: Ti.UI.FILL
});

var view4 = Ti.UI.createView({
	backgroundColor: getRandomColor(),
	accessibilityLabel: 'view4Label',
	accessibilityValue: 'view4Value',
	height: 10,
	width: Ti.UI.FILL
});

var view5 = Ti.UI.createView({
	backgroundColor: getRandomColor(),
	accessibilityLabel: 'view5Label',
	accessibilityHint: 'view5Hint',
	height: 10,
	width: Ti.UI.FILL
});

var view6 = Ti.UI.createView({
	backgroundColor: getRandomColor(),
	accessibilityValue: 'view6Value',
	accessibilityHint: 'view6Hint',
	height: 10,
	width: Ti.UI.FILL
});

var view7 = Ti.UI.createView({
	backgroundColor: getRandomColor(),
	accessibilityLabel: 'view7Label',
	accessibilityValue: 'view7Value',
	accessibilityHint: 'view7Hint',
	height: 10,
	width: Ti.UI.FILL
});

win.add(view1);
win.add(view2);
win.add(view3);
win.add(view4);
win.add(view5);
win.add(view6);
win.add(view7);

win.open();

appium-android
appium-ios

Copy link
Contributor

@vijaysingh-axway vijaysingh-axway left a comment

Choose a reason for hiding this comment

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

@drauggres There is one minor issue. Please fix that.

iphone/Classes/TiUINavBarButton.m Show resolved Hide resolved
Copy link
Contributor

@vijaysingh-axway vijaysingh-axway left a comment

Choose a reason for hiding this comment

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

CR passed.

@keerthi1032
Copy link
Contributor

FR Passed. accessibility identifier is added. tested with test code provided in PR.works as expected

Test Environment:
Name = Mac OS X
Version = 10.13.6
Architecture = 64bit
Node.js
Node.js Version = 8.9.1
npm Version = 5.5.1
Titanium CLI
CLI Version = 5.1.1
Titanium SDK
SDK Version =local sdk 8.1.0.v20190515144948
Device =iPhone X iOS 11
Simulator =iphone XS iOS 12

@keerthi1032 keerthi1032 merged commit 2a16df7 into tidev:master May 16, 2019
@ygbr
Copy link

ygbr commented Jul 24, 2019

can we get this back-ported to 7.5.X?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants