Skip to content

Fix for test_edit_tenant failure triggered by widgetastic fill() method#1054

Draft
cathal-bailey wants to merge 1 commit into
3scale-qe:mainfrom
cathal-bailey:test-edit-tenant-fix
Draft

Fix for test_edit_tenant failure triggered by widgetastic fill() method#1054
cathal-bailey wants to merge 1 commit into
3scale-qe:mainfrom
cathal-bailey:test-edit-tenant-fix

Conversation

@cathal-bailey

Copy link
Copy Markdown
Collaborator
  • Widgetastic's TextInput.fill() method is appending text instead of replacing the existing value in the input field, even though it's supposed to clear and replace by default. This is causing test_edit_tenant to fail persistently.
  • A replace() method has been added to tenant.py, alongside the existing update() method
  • The replace() accessed the element directly through selenium and forces self.org_name to clear before updating it, which resolves the failure

@mdujava

mdujava commented Jun 30, 2026

Copy link
Copy Markdown
Member

Is this the only time .fill( does not replace the value? do we need original function then, I assume its never used, so I wouldn't like to keep unused function.

Maybe its worth to check if element is defined same way as other inputs (without this problem), if there are differences and maybe debounc might sneak some data after selenium fill, and react state combine them ...

@cathal-bailey

Copy link
Copy Markdown
Collaborator Author

Maybe its worth to check if element is defined same way as other inputs (without this problem), if there are differences and maybe debounc might sneak some data after selenium fill, and react state combine them ...

No other tests are using the TenantEditView.update(), so method separation is redundant. I'll fix this.

There are some other tests using fill() method to edit existing fields, but the implementation is slightly different, like here for instance:

edit.update("updated_name", "updated_description", "https://updated_endpoint")

def update(self, name: str = "", desc: str = "", endpoint: str = ""):

I don't believe we've seen any fails from the other tests yet. I suspect the failures in test_edit_tenant may be timing related (Form field not full ready when fill() is called), so I think it is better to explicitly clear the field first to ensure the test works correctly.

@cathal-bailey
cathal-bailey force-pushed the test-edit-tenant-fix branch from 806edda to b88b407 Compare June 30, 2026 12:10
@mdujava

mdujava commented Jun 30, 2026

Copy link
Copy Markdown
Member

as its same fill followed by button click in both tests, I would suspect that tenant form webpage js might be doing something different;
first report to dev or check if we don't see some differences in a js => no need to "relax" test, but fix the issue

Also I have seen that there are 2 different strategies for fill, one of which waits on some kind of presence on webpage so maybe we just need to update which strategy to use

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants