mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01:00
[server-pro] tests: backport changes from SaaS E2E tests (#23921)
* [server-pro] tests: add helper for gitURL * [server-pro] tests: avoid hard-coding URL scheme/origin * [server-pro] tests: fix typo in query selector * [server-pro] tests: fix spelling of GitHub * [server-pro] tests: double down on matching email in body * [server-pro] tests: speed up session resumption * [server-pro] tests: use a single project in editor spec * [server-pro] drop check on started recompile The labels changed between versions and making it configurable is too verbose. GitOrigin-RevId: d1ace3b534f28c65b8e20c808bac12268f26fa4d
This commit is contained in:
@@ -22,7 +22,12 @@ describe('git-bridge', function () {
|
||||
V1_HISTORY_URL: 'http://sharelatex:3100/api',
|
||||
}
|
||||
|
||||
const gitBridgePublicHost = new URL(Cypress.config().baseUrl!).host
|
||||
function gitURL(projectId: string) {
|
||||
const url = new URL(Cypress.config().baseUrl!)
|
||||
url.username = 'git'
|
||||
url.pathname = `/git/${projectId}`
|
||||
return url
|
||||
}
|
||||
|
||||
describe('enabled in Server Pro', function () {
|
||||
if (isExcludedBySharding('PRO_CUSTOM_1')) return
|
||||
@@ -85,9 +90,7 @@ describe('git-bridge', function () {
|
||||
cy.findByText('Git').click()
|
||||
cy.findByTestId('git-bridge-modal').within(() => {
|
||||
cy.get('@projectId').then(id => {
|
||||
cy.get('code').contains(
|
||||
`git clone http://git@${gitBridgePublicHost}/git/${id}`
|
||||
)
|
||||
cy.get('code').contains(`git clone ${gitURL(id.toString())}`)
|
||||
})
|
||||
cy.findByRole('button', {
|
||||
name: 'Generate token',
|
||||
@@ -101,9 +104,7 @@ describe('git-bridge', function () {
|
||||
cy.findByText('Git').click()
|
||||
cy.findByTestId('git-bridge-modal').within(() => {
|
||||
cy.get('@projectId').then(id => {
|
||||
cy.get('code').contains(
|
||||
`git clone http://git@${gitBridgePublicHost}/git/${id}`
|
||||
)
|
||||
cy.get('code').contains(`git clone ${gitURL(id.toString())}`)
|
||||
})
|
||||
cy.findByText('Generate token').should('not.exist')
|
||||
cy.findByText(/generate a new one in Account Settings/)
|
||||
@@ -192,9 +193,7 @@ describe('git-bridge', function () {
|
||||
cy.findByText('Git').click()
|
||||
cy.get('@projectId').then(projectId => {
|
||||
cy.findByTestId('git-bridge-modal').within(() => {
|
||||
cy.get('code').contains(
|
||||
`git clone http://git@${gitBridgePublicHost}/git/${projectId}`
|
||||
)
|
||||
cy.get('code').contains(`git clone ${gitURL(projectId.toString())}`)
|
||||
})
|
||||
cy.findByRole('button', {
|
||||
name: 'Generate token',
|
||||
@@ -234,9 +233,11 @@ describe('git-bridge', function () {
|
||||
dir,
|
||||
fs,
|
||||
}
|
||||
const url = gitURL(projectId.toString())
|
||||
url.username = '' // basic auth is specified separately.
|
||||
const httpOptions = {
|
||||
http,
|
||||
url: `http://sharelatex/git/${projectId}`,
|
||||
url: url.toString(),
|
||||
headers: {
|
||||
Authorization: `Basic ${Buffer.from(`git:${token}`).toString('base64')}`,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user