Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit ce0e7a0

Browse files
committed
spec update
1 parent e58648d commit ce0e7a0

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

spec/system/embeddings/ai_embedding_definition_spec.rb

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
find("[data-preset-id='text-embedding-3-small'] button").click()
1818

19-
find("input.form-kit__control-password").fill_in(with: api_key)
19+
find(".form-kit__control-password").fill_in(with: api_key)
2020
find(".ai-embedding-editor__save").click()
2121

2222
expect(page).to have_current_path("/admin/plugins/discourse-ai/ai-embeddings")
@@ -47,28 +47,22 @@
4747

4848
find("#control-display_name input").fill_in(with: "text-embedding-3-small")
4949

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)
5351

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)
5654

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")
6056

6157
embed_prefix = "On creation:"
6258
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)
6563

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")
6865

69-
select_kit = PageObjects::Components::SelectKit.new(".ai-embedding-editor__distance_functions")
70-
select_kit.expand
71-
select_kit.select_row_by_value("<=>")
7266
find(".ai-embedding-editor__save").click()
7367

7468
expect(page).to have_current_path("/admin/plugins/discourse-ai/ai-embeddings")

0 commit comments

Comments
 (0)