Skip to content

Commit 47fe2fb

Browse files
committed
fix ai e2e
1 parent 01147f7 commit 47fe2fb

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

apps/remix-ide-e2e/src/tests/ai_panel.test.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ module.exports = {
2121
browser
2222
.addFile('Untitled.sol', sources[0]['Untitled.sol'])
2323
},
24-
24+
// Conversation starter button with data id 'explain-editor' doesn't exist anymore
2525
'Should explain the contract #group1': function (browser: NightwatchBrowser) {
2626
browser
27-
.waitForElementVisible('*[data-id="explain-editor"]')
28-
.click('*[data-id="explain-editor"]')
27+
.waitForElementVisible('*[data-id="remix-ai-assistant-suggestion-Explain-what-a-modifier-is"]')
28+
.click('*[data-id="remix-ai-assistant-suggestion-Explain-what-a-modifier-is"]')
2929
.waitForElementVisible('*[data-id="remix-ai-assistant"]')
3030
.waitForElementVisible({
3131
locateStrategy: 'xpath',
32-
selector: '//div[contains(@class,"chat-bubble") and contains(.,"Explain the current code")]'
32+
selector: '//div[contains(@class,"chat-bubble") and contains(.,"Explain what a modifier is")]'
3333
})
3434
.waitForElementPresent({
3535
locateStrategy: 'xpath',
@@ -80,7 +80,6 @@ module.exports = {
8080
locateStrategy: 'xpath',
8181
timeout: 120000
8282
})
83-
.waitForElementVisible('*[data-id="remix-ai-assistant"]')
8483
.waitForElementPresent('*[data-id="remix-ai-assistant-ready"]')
8584
.assistantAddContext('currentFile')
8685
.waitForElementVisible({
@@ -171,7 +170,6 @@ module.exports = {
171170
locateStrategy: 'xpath',
172171
timeout: 120000
173172
})
174-
.waitForElementVisible('*[data-id="remix-ai-assistant"]')
175173
.waitForElementVisible('*[data-id="composer-ai-workspace-generate"]')
176174
.click('*[data-id="composer-ai-workspace-generate"]')
177175
.waitForElementVisible('*[data-id="generate-workspaceModalDialogModalBody-react"]')
@@ -229,8 +227,6 @@ module.exports = {
229227
locateStrategy: 'xpath',
230228
selector: "//*[@data-id='remix-ai-streaming' and @data-streaming='false']"
231229
})
232-
233-
234230
},
235231
'Generate new workspaces code with all AI assistant providers #group1': function (browser: NightwatchBrowser) {
236232
browser
@@ -250,8 +246,6 @@ module.exports = {
250246
locateStrategy: 'xpath',
251247
selector: "//*[@data-id='remix-ai-streaming' and @data-streaming='false']"
252248
})
253-
254-
255249
.assistantClearChat()
256250

257251
.clickLaunchIcon('remixaiassistant')
@@ -269,7 +263,6 @@ module.exports = {
269263
},
270264
"Should close the AI assistant #group1": function (browser: NightwatchBrowser) {
271265
browser
272-
.waitForElementVisible('*[data-id="remix-ai-assistant"]')
273266
.click('*[data-id="movePluginToLeft"]')
274267
.clickLaunchIcon('filePanel')
275268
.waitForElementNotVisible('*[data-id="remix-ai-assistant"]', 5000)

libs/remix-ui/remix-ai-assistant/src/components/chat.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export const ChatHistoryComponent: React.FC<ChatHistoryComponentProps> = ({
4242
{DEFAULT_SUGGESTIONS.map(s => (
4343
<button
4444
key={s}
45+
data-id={`remix-ai-assistant-suggestion-${s.replace(/\s+/g, '-')}`}
4546
className="btn btn-secondary mb-2 w-100 text-left"
4647
onClick={() => sendPrompt(s)}
4748
>
@@ -66,7 +67,7 @@ export const ChatHistoryComponent: React.FC<ChatHistoryComponentProps> = ({
6667
)}
6768

6869
{/* Bubble */}
69-
<div data-region="chat-bubble-section" className="flex-grow-1 w-25 mr-1">
70+
<div data-id="ai-response-chat-bubble-section" className="flex-grow-1 w-25 mr-1">
7071
<div className={`chat-bubble p-2 rounded ${bubbleClass}`}>
7172
{msg.role === 'user' && (
7273
<small className="text-uppercase fw-bold text-secondary d-block mb-1">

0 commit comments

Comments
 (0)