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

E2E-Tests: Ion-Input is broken on Ionic7 projects #11

Open
1 task done
Saibotig opened this issue Jun 30, 2023 · 0 comments
Open
1 task done

E2E-Tests: Ion-Input is broken on Ionic7 projects #11

Saibotig opened this issue Jun 30, 2023 · 0 comments
Labels

Comments

@Saibotig
Copy link

I'm submitting a

  • bug report

Current behavior:
In e2e testing of ionic7 projects, the ion-input is not accessible / no value can be set.

Expected behavior:
Can set a value through the helpers class IonicInput

Steps to reproduce:
Try to use the helpers in an Ionic7 project.

In my opinion, you just have to look which changes the Ion-Input got from 6 ⇾ 7 and adjust the class IonicInput accordingly. I assume other components did change as well, and maybe the repo ionic-e2e-example needs an entire upgrade to ionic7 as well. Maybe as a tag in repo to switch back to 6 any time.

Related code:

export class IonicInput extends IonicComponent {
constructor(selector: string) {
super(selector);
}
async setValue(
value: string,
{ visibilityTimeout = 5000 }: ElementActionOptions = {}
) {
const el = await Ionic$.$(this.selector as string);
await el.waitForDisplayed({ timeout: visibilityTimeout });
const ionTags = ['ion-input', 'ion-textarea'];
if (ionTags.indexOf(await el.getTagName()) >= 0) {
const input = await el.$('input,textarea');
await input.setValue(value);
} else {
return el.setValue(value);
}
}
async getValue({ visibilityTimeout = 5000 }: ElementActionOptions = {}) {
const el = await Ionic$.$(this.selector as string);
await el.waitForDisplayed({ timeout: visibilityTimeout });
const ionTags = ['ion-input', 'ion-textarea'];
if (ionTags.indexOf(await el.getTagName()) >= 0) {
const input = await el.$('input,textarea');
return input.getValue();
} else {
return el.getValue();
}
}
}

Other information:

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

Ionic:

Ionic CLI : 7.1.1
Ionic Framework : @ionic/react 7.0.14

Capacitor:

Capacitor CLI : 5.0.5
@capacitor/android : 5.0.5
@capacitor/core : 5.0.5
@capacitor/ios : 5.0.5

Utility:

cordova-res : not installed globally
native-run : 1.7.2

System:

NodeJS : v19.7.0
npm : 9.5.0
OS : Linux 5.19

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

No branches or pull requests

1 participant