import { AppPage } from './app.po';
import { browser, logging, element,by } from 'protractor';
describe('workspace-project App', () => {
let page: AppPage;
let title;
beforeEach(() => {
page = new AppPage();
});
it('should display welcome message', async() => {
page.navigateTo();
title = await page.getTitleText();
console.log(title)
expect(page.getTitleText()).toEqual('scriptless app is running!');
});
it('print the global title variable',()=>{
console.log(title)
})
afterEach(async () => {
// Assert that there are no errors emitted from the browser
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
expect(logs).not.toContain(jasmine.objectContaining({
level: logging.Level.SEVERE,
} as logging.Entry));
});
});
Объявление переменной глобальной области видимости. Присвойте ему значение в одном it (), а затем используйте в другом.
А ваш console.log(text)
что-то печатает?