diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 659f38e24a5..f2887e231e4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -274,6 +274,10 @@ jobs: if: matrix.build_type == 'system' run: script/assemble_ember_build.rb + - name: Install playwright + if: matrix.build_type == 'system' + run: pnpm playwright install --with-deps --no-shell chromium + - name: Core System Tests if: matrix.build_type == 'system' && matrix.target == 'core' env: diff --git a/bin/ember-cli b/bin/ember-cli index 364f6b26c25..10f46039383 100755 --- a/bin/ember-cli +++ b/bin/ember-cli @@ -60,6 +60,8 @@ if !system "pnpm", "--dir=#{RAILS_ROOT}", "install" exit 1 end +system "pnpm", "playwright", "install", "--with-deps", "--no-shell", "chromium" + pnpm_env = { "TERM" => "dumb", # simple output from ember-cli, so we can parse/forward it more easily } diff --git a/spec/fixtures/media/small.webm b/spec/fixtures/media/small.webm new file mode 100644 index 00000000000..1b33bdc9449 Binary files /dev/null and b/spec/fixtures/media/small.webm differ diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index eac39792444..3eb81ab7221 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -459,7 +459,7 @@ RSpec.configure do |config| driver_options = { browser_type: :chromium, - channel: :chrome, + channel: :chromium, headless: (ENV["PLAYWRIGHT_HEADLESS"].presence || ENV["SELENIUM_HEADLESS"].presence) != "0", args: apply_base_chrome_args, acceptDownloads: true, @@ -684,7 +684,7 @@ RSpec.configure do |config| if !ENV["CI"] puts "\n🎥 Recorded video for: #{example.metadata[:full_description]}\n" - puts "#{File.join(Rails.root, saved_path)}\n" + puts "#{saved_path}\n" end end end @@ -701,7 +701,7 @@ RSpec.configure do |config| if !ENV["CI"] puts "\n🧭 Saved trace for: #{example.metadata[:full_description]}\n" - puts "Open with `pnpm playwright show-trace #{File.join(Rails.root, saved_path)}`\n" + puts "Open with `pnpm playwright show-trace #{saved_path}`\n" end end end diff --git a/spec/system/composer/prosemirror_editor_spec.rb b/spec/system/composer/prosemirror_editor_spec.rb index 87b79a3aee6..54db05a6e20 100644 --- a/spec/system/composer/prosemirror_editor_spec.rb +++ b/spec/system/composer/prosemirror_editor_spec.rb @@ -366,7 +366,7 @@ describe "Composer - ProseMirror editor", type: :system do cdp.copy_paste("https://example.com/x") composer.type_content(:space).type_content("and").type_content(:space) cdp.paste - composer.type_content("\n") + composer.type_content(:enter) expect(rich).to have_css( "a.inline-onebox[href='https://example.com/x']", diff --git a/spec/system/composer/review_media_unless_trust_level_spec.rb b/spec/system/composer/review_media_unless_trust_level_spec.rb index 9ba2fffeaaf..af114daf4d3 100644 --- a/spec/system/composer/review_media_unless_trust_level_spec.rb +++ b/spec/system/composer/review_media_unless_trust_level_spec.rb @@ -4,7 +4,9 @@ describe "Composer using review_media", type: :system do fab!(:current_user) { Fabricate(:user, refresh_auto_groups: true) } fab!(:topic) { Fabricate(:topic, category: Category.find(SiteSetting.uncategorized_category_id)) } fab!(:post) { Fabricate(:post, topic: topic) } + let(:topic_page) { PageObjects::Pages::Topic.new } + let(:composer) { PageObjects::Components::Composer.new } before do SiteSetting.skip_review_media_groups = Group::AUTO_GROUPS[:trust_level_3] @@ -25,14 +27,12 @@ describe "Composer using review_media", type: :system do it "flags a post with an image" do topic_page.visit_topic_and_open_composer(topic) topic_page.fill_in_composer(" this one has an upload: ") - attach_file "file-uploader", - "#{Rails.root}/spec/fixtures/images/logo.jpg", - make_visible: { - display: "block", - visibility: "visible", - opacity: 1, - } + attach_file(file_from_fixtures("logo.jpg", "images").path) do + composer.click_toolbar_button("upload") + end + within(".d-editor-preview") { expect(page).to have_css("img") } + topic_page.send_reply expect(page).to have_css(".post-enqueued-modal") diff --git a/spec/system/composer_uploads_spec.rb b/spec/system/composer_uploads_spec.rb index d3a752566a6..6106fee0985 100644 --- a/spec/system/composer_uploads_spec.rb +++ b/spec/system/composer_uploads_spec.rb @@ -40,7 +40,7 @@ describe "Uploading files in the composer", type: :system do context "when video thumbnails are enabled" do before do SiteSetting.video_thumbnails_enabled = true - SiteSetting.authorized_extensions += "|mp4" + SiteSetting.authorized_extensions += "|webm" end it "generates a topic preview thumbnail from the video" do @@ -48,7 +48,7 @@ describe "Uploading files in the composer", type: :system do expect(composer).to be_opened topic.fill_in_composer_title("Video upload test") - file_path_1 = file_from_fixtures("small.mp4", "media").path + file_path_1 = file_from_fixtures("small.webm", "media").path attach_file(file_path_1) { composer.click_toolbar_button("upload") } expect(composer).to have_no_in_progress_uploads @@ -65,7 +65,7 @@ describe "Uploading files in the composer", type: :system do expect(composer).to be_opened topic.fill_in_composer_title("Video upload test") - file_path_1 = file_from_fixtures("small.mp4", "media").path + file_path_1 = file_from_fixtures("small.webm", "media").path attach_file(file_path_1) { composer.click_toolbar_button("upload") } expect(composer).to have_no_in_progress_uploads @@ -99,7 +99,7 @@ describe "Uploading files in the composer", type: :system do HTMLVideoElement.prototype.__defineGetter__('videoHeight', function() { return 0; }); JS - file_path_1 = file_from_fixtures("small.mp4", "media").path + file_path_1 = file_from_fixtures("small.webm", "media").path attach_file(file_path_1) { composer.click_toolbar_button("upload") } expect(composer).to have_no_in_progress_uploads @@ -131,7 +131,7 @@ describe "Uploading files in the composer", type: :system do }; JS - file_path_1 = file_from_fixtures("small.mp4", "media").path + file_path_1 = file_from_fixtures("small.webm", "media").path attach_file(file_path_1) { composer.click_toolbar_button("upload") } expect(composer).to have_no_in_progress_uploads