|
16 | 16 |
|
17 | 17 | find("[data-preset-id='text-embedding-3-small'] button").click() |
18 | 18 |
|
19 | | - find("input.form-kit__control-password").fill_in(with: api_key) |
| 19 | + find(".form-kit__control-password").fill_in(with: api_key) |
20 | 20 | find(".ai-embedding-editor__save").click() |
21 | 21 |
|
22 | 22 | expect(page).to have_current_path("/admin/plugins/discourse-ai/ai-embeddings") |
|
47 | 47 |
|
48 | 48 | find("#control-display_name input").fill_in(with: "text-embedding-3-small") |
49 | 49 |
|
50 | | - select_kit = PageObjects::Components::SelectKit.new(".ai-embedding-editor__provider") |
51 | | - select_kit.expand |
52 | | - select_kit.select_row_by_value(EmbeddingDefinition::OPEN_AI) |
| 50 | + find("#control-provider select").select(EmbeddingDefinition::OPEN_AI) |
53 | 51 |
|
54 | | - find("input.ai-embedding-editor__url").fill_in(with: "https://api.openai.com/v1/embeddings") |
55 | | - find("input.ai-embedding-editor__api-key").fill_in(with: api_key) |
| 52 | + find("#control-url input").fill_in(with: "https://api.openai.com/v1/embeddings") |
| 53 | + find("#control-api_key input").fill_in(with: api_key) |
56 | 54 |
|
57 | | - select_kit = PageObjects::Components::SelectKit.new(".ai-embedding-editor__tokenizer") |
58 | | - select_kit.expand |
59 | | - select_kit.select_row_by_value("DiscourseAi::Tokenizer::OpenAiTokenizer") |
| 55 | + find("#control-tokenizer_class select").select("OpenAiTokenizer") |
60 | 56 |
|
61 | 57 | embed_prefix = "On creation:" |
62 | 58 | search_prefix = "On search:" |
63 | | - find(".ai-embedding-editor__embed_prompt").fill_in(with: embed_prefix) |
64 | | - find(".ai-embedding-editor__search_prompt").fill_in(with: search_prefix) |
| 59 | + find("#control-embed_prompt textarea").fill_in(with: embed_prefix) |
| 60 | + find("#control-search_prompt textarea").fill_in(with: search_prefix) |
| 61 | + find("#control-dimensions input").fill_in(with: 1536) |
| 62 | + find("#control-max_sequence_length input").fill_in(with: 8191) |
65 | 63 |
|
66 | | - find("input.ai-embedding-editor__dimensions").fill_in(with: 1536) |
67 | | - find("input.ai-embedding-editor__max_sequence_length").fill_in(with: 8191) |
| 64 | + find("#control-pg_function select").select("Cosine distance") |
68 | 65 |
|
69 | | - select_kit = PageObjects::Components::SelectKit.new(".ai-embedding-editor__distance_functions") |
70 | | - select_kit.expand |
71 | | - select_kit.select_row_by_value("<=>") |
72 | 66 | find(".ai-embedding-editor__save").click() |
73 | 67 |
|
74 | 68 | expect(page).to have_current_path("/admin/plugins/discourse-ai/ai-embeddings") |
|
0 commit comments