Fix remaining failures in new_project_spec.rb after !228726
What does this MR do and why?
After !228726 (merged) landed, I monitored the Grafana dashboard and spotted two consistent failures in ee/spec/features/projects/new_project_spec.rb across multiple CI jobs.
Fix 1, creates a new project in personal namespace (intermittent)
Project.last was being called before the page finished navigating, returning nil and causing a routing error. The previous guard (expect(page).not_to have_content(...)) wasn't reliable enough in CI. Fixed by waiting for the URL to match the user's namespace path first, which only resolves after a successful redirect and project creation.
Fix 2, creates CI/CD project from GitHub
Clicking "Connect" triggers an async frontend poll of the GitHub import status. The "Continue import" button stays disabled until that poll resolves, but click_button 'Continue import' was called immediately after with no wait, timing out consistently. Fixed by adding wait_for_requests between the two clicks.
How to validate
bundle exec rspec ee/spec/features/projects/new_project_spec.rb
Related issues
Related to https://gitlab.com/gitlab-org/quality/test-failure-issues/-/work_items/39604